]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
support unions too in Luawrapper
authorbert hubert <bert.hubert@netherlabs.nl>
Thu, 19 Feb 2015 08:45:55 +0000 (09:45 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Thu, 19 Feb 2015 08:45:55 +0000 (09:45 +0100)
pdns/ext/luawrapper/include/LuaContext.hpp

index b4bb19fec2d5797cf8c795c3163aa5164868137e..e58e5d15517868d357e0e6f9789b4738f9735a4f 100644 (file)
@@ -1041,7 +1041,7 @@ private:
     template<typename TFunctionType, typename TRetValue, typename TObject, typename... TOtherParams>
     void registerFunctionImpl(const std::string& functionName, TFunctionType function, tag<TObject>, tag<TRetValue (TOtherParams...)>)
     {
-        static_assert(std::is_class<TObject>::value || std::is_pointer<TObject>::value, "registerFunction can only be used for a class or a pointer");
+        static_assert(std::is_class<TObject>::value || std::is_pointer<TObject>::value || std::is_union<TObject>::value , "registerFunction can only be used for a class or a pointer");
 
         checkTypeRegistration(mState, &typeid(TObject));
         setTable<TRetValue(TObject&, TOtherParams...)>(mState, Registry, &typeid(TObject), 0, functionName, std::move(function));