weeee gating things

This commit is contained in:
ThePhD 2018-11-21 15:32:46 -05:00
parent a6186c4666
commit c61a434561
No known key found for this signature in database
GPG Key ID: 1509DB1C0F702BFA

View File

@ -64,13 +64,13 @@ namespace sol {
template <typename K, typename V, typename H = std::hash<K>, typename E = std::equal_to<>> template <typename K, typename V, typename H = std::hash<K>, typename E = std::equal_to<>>
using map_t = std::unordered_map<K, V, H, E>; using map_t = std::unordered_map<K, V, H, E>;
#endif // Boost map target #endif // Boost map target
} } // namespace usertype_detail
namespace detail { namespace detail {
#ifdef SOL_NOEXCEPT_FUNCTION_TYPE #ifdef SOL_NOEXCEPT_FUNCTION_TYPE
typedef int(*lua_CFunction_noexcept)(lua_State* L) noexcept; typedef int (*lua_CFunction_noexcept)(lua_State* L) noexcept;
#else #else
typedef int(*lua_CFunction_noexcept)(lua_State* L); typedef int (*lua_CFunction_noexcept)(lua_State* L);
#endif // noexcept function type for lua_CFunction #endif // noexcept function type for lua_CFunction
template <typename T> template <typename T>
@ -115,7 +115,7 @@ namespace sol {
namespace detail { namespace detail {
struct non_lua_nil_t {}; struct non_lua_nil_t {};
} } // namespace detail
struct metatable_t {}; struct metatable_t {};
const metatable_t metatable_key = {}; const metatable_t metatable_key = {};
@ -609,8 +609,7 @@ namespace sol {
}; };
inline const std::string& to_string(call_status c) { inline const std::string& to_string(call_status c) {
static const std::array<std::string, 10> names{ { static const std::array<std::string, 10> names{ { "ok",
"ok",
"yielded", "yielded",
"runtime", "runtime",
"memory", "memory",
@ -619,8 +618,7 @@ namespace sol {
"syntax", "syntax",
"file", "file",
"CRITICAL_EXCEPTION_FAILURE", "CRITICAL_EXCEPTION_FAILURE",
"CRITICAL_INDETERMINATE_STATE_FAILURE" "CRITICAL_INDETERMINATE_STATE_FAILURE" } };
} };
switch (c) { switch (c) {
case call_status::ok: case call_status::ok:
return names[0]; return names[0];
@ -662,15 +660,13 @@ namespace sol {
} }
inline const std::string& to_string(load_status c) { inline const std::string& to_string(load_status c) {
static const std::array<std::string, 7> names{ { static const std::array<std::string, 7> names{ { "ok",
"ok",
"memory", "memory",
"gc", "gc",
"syntax", "syntax",
"file", "file",
"CRITICAL_EXCEPTION_FAILURE", "CRITICAL_EXCEPTION_FAILURE",
"CRITICAL_INDETERMINATE_STATE_FAILURE" "CRITICAL_INDETERMINATE_STATE_FAILURE" } };
} };
switch (c) { switch (c) {
case load_status::ok: case load_status::ok:
return names[0]; return names[0];
@ -772,8 +768,7 @@ namespace sol {
"__ipairs", "__ipairs",
"next", "next",
"__type", "__type",
"__typeinfo" "__typeinfo" } };
} };
return names; return names;
} }
@ -830,19 +825,10 @@ namespace sol {
struct is_container<T, std::enable_if_t<meta::is_string_like<meta::unqualified_t<T>>::value>> : std::false_type {}; struct is_container<T, std::enable_if_t<meta::is_string_like<meta::unqualified_t<T>>::value>> : std::false_type {};
template <typename T> template <typename T>
struct is_container<T, std::enable_if_t<meta::all< struct is_container<T, std::enable_if_t<meta::all<std::is_array<meta::unqualified_t<T>>, meta::neg<meta::any_same<std::remove_all_extents_t<meta::unqualified_t<T>>, char, wchar_t, char16_t, char32_t>>>::value>> : std::true_type {};
std::is_array<meta::unqualified_t<T>>
, meta::neg<meta::any_same<std::remove_all_extents_t<meta::unqualified_t<T>>, char, wchar_t, char16_t, char32_t>>
>::value
>> : std::true_type {};
template <typename T> template <typename T>
struct is_container<T, std::enable_if_t<meta::all< struct is_container<T, std::enable_if_t<meta::all<meta::has_begin_end<meta::unqualified_t<T>>, meta::neg<is_initializer_list<meta::unqualified_t<T>>>, meta::neg<meta::is_string_like<meta::unqualified_t<T>>>>::value>> : std::true_type {};
meta::has_begin_end<meta::unqualified_t<T>>
, meta::neg<is_initializer_list<meta::unqualified_t<T>>>
, meta::neg<meta::is_string_like<meta::unqualified_t<T>>>
>::value
>> : std::true_type {};
} // namespace detail } // namespace detail
template <typename T> template <typename T>
@ -996,8 +982,10 @@ namespace sol {
template <typename T> template <typename T>
struct lua_type_of<optional<T>> : std::integral_constant<type, type::poly> {}; struct lua_type_of<optional<T>> : std::integral_constant<type, type::poly> {};
#if defined(SOL_CXX17_FEATURES) && SOL_CXX17_FEATURES
template <typename T> template <typename T>
struct lua_type_of<std::optional<T>> : std::integral_constant<type, type::poly> {}; struct lua_type_of<std::optional<T>> : std::integral_constant<type, type::poly> {};
#endif // std::optional
template <> template <>
struct lua_type_of<variadic_args> : std::integral_constant<type, type::poly> {}; struct lua_type_of<variadic_args> : std::integral_constant<type, type::poly> {};
@ -1129,6 +1117,10 @@ namespace sol {
struct is_lua_primitive<light<T>> : is_lua_primitive<T*> {}; struct is_lua_primitive<light<T>> : is_lua_primitive<T*> {};
template <typename T> template <typename T>
struct is_lua_primitive<optional<T>> : std::true_type {}; struct is_lua_primitive<optional<T>> : std::true_type {};
#if defined(SOL_CXX17_FEATURES) && SOL_CXX17_FEATURES
template <typename T>
struct is_lua_primitive<std::optional<T>> : std::true_type {};
#endif
template <typename T> template <typename T>
struct is_lua_primitive<as_table_t<T>> : std::true_type {}; struct is_lua_primitive<as_table_t<T>> : std::true_type {};
template <typename T> template <typename T>