# include "misc/exception.hpp"
#endif
+#ifdef __GNUC__
+# define ATTR_UNUSED __attribute__((unused))
+#else
+# define ATTR_UNUSED
+#endif
+
/**
* Defines a Lua context
* A Lua context is used to interpret Lua code. Since everything in Lua is a variable (including functions),
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 || std::is_union<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 a union or a pointer");
checkTypeRegistration(mState, &typeid(TObject));
setTable<TRetValue(TObject&, TOtherParams...)>(mState, Registry, &typeid(TObject), 0, functionName, std::move(function));
};
/// @deprecated
-//static LuaContext::EmptyArray_t
-// LuaEmptyArray {};
+static LuaContext::EmptyArray_t ATTR_UNUSED
+ LuaEmptyArray {};
/// @deprecated
-//static LuaContext::Metatable_t
-// LuaMetatable {};
+static LuaContext::Metatable_t ATTR_UNUSED
+ LuaMetatable {};
/**************************************************/
/* PARTIAL IMPLEMENTATIONS */
struct LuaContext::PusherTotalMaxSize<> { static const int size = 0; };
// implementation of PusherMinSize
-template<typename TFirst, typename... TTypes>
-struct LuaContext::PusherMinSize<TFirst, TTypes...> { static const int size = Pusher<typename std::decay<TFirst>::type>::minSize < PusherTotalMaxSize<TTypes...>::size ? Pusher<typename std::decay<TFirst>::type>::minSize : PusherMinSize<TTypes...>::size; };
-template<>
-struct LuaContext::PusherMinSize<> { static const int size = 0; };
+template<typename TFirst, typename TSecond, typename... TTypes>
+struct LuaContext::PusherMinSize<TFirst, TSecond, TTypes...>
+{
+ static const int size = Pusher<typename std::decay<TFirst>::type>::minSize < Pusher<typename std::decay<TSecond>::type>::minSize
+ ?
+ PusherMinSize<typename std::decay<TFirst>::type, TTypes...>::size
+ :
+ PusherMinSize<typename std::decay<TSecond>::type, TTypes...>::size;
+};
+
+template<typename TFirst>
+struct LuaContext::PusherMinSize<TFirst> { static const int size = Pusher<typename std::decay<TFirst>::type>::minSize; };
// implementation of PusherMaxSize
template<typename TFirst, typename... TTypes>