diff --git a/Plugins/UnLua/Source/UnLua/Public/UnLuaTemplate.h b/Plugins/UnLua/Source/UnLua/Public/UnLuaTemplate.h index 02797a5b..d9a7d3bc 100644 --- a/Plugins/UnLua/Source/UnLua/Public/UnLuaTemplate.h +++ b/Plugins/UnLua/Source/UnLua/Public/UnLuaTemplate.h @@ -20,10 +20,26 @@ namespace UnLua { + /** + * Reference + * 1.https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94003 + * 2.https://codereview.stackexchange.com/questions/273221/an-rough-implementation-of-stdis-constructible + */ + template + struct is_constructible_impl : std::false_type {}; + + template + struct is_constructible_impl()...) + ), void()), T, Args...> : std::true_type {}; + + template + struct is_constructible : is_constructible_impl {}; + /** * Traits class which tests if a type is constructible */ - template struct TIsConstructible { enum { Value = std::is_constructible::value }; }; + template struct TIsConstructible { enum { Value = is_constructible::value }; }; template struct TIsCopyConstructible { enum { Value = std::is_copy_constructible::value }; }; template struct TIsDestructible { enum { Value = std::is_destructible::value }; };