push_reference must respect unique_usertypes are primitives

This commit is contained in:
ThePhD 2016-08-21 19:20:31 -04:00
parent 5f036adf48
commit ec97dac651

View File

@ -620,6 +620,9 @@ namespace sol {
struct accumulate<C, v, V, T, Args...> : accumulate<C, v + V<T>::value, V, Args...> {}; struct accumulate<C, v, V, T, Args...> : accumulate<C, v + V<T>::value, V, Args...> {};
} // detail } // detail
template <typename T>
struct is_unique_usertype : std::integral_constant<bool, unique_usertype_traits<T>::value> {};
template <typename T> template <typename T>
struct lua_type_of : detail::lua_type_of<T> {}; struct lua_type_of : detail::lua_type_of<T> {};
@ -636,6 +639,7 @@ namespace sol {
struct is_lua_primitive : std::integral_constant<bool, struct is_lua_primitive : std::integral_constant<bool,
type::userdata != lua_type_of<meta::unqualified_t<T>>::value type::userdata != lua_type_of<meta::unqualified_t<T>>::value
|| (lua_size<T>::value > 1) || (lua_size<T>::value > 1)
|| is_unique_usertype<T>::value
|| std::is_base_of<reference, meta::unqualified_t<T>>::value || std::is_base_of<reference, meta::unqualified_t<T>>::value
|| std::is_base_of<stack_reference, meta::unqualified_t<T>>::value || std::is_base_of<stack_reference, meta::unqualified_t<T>>::value
|| meta::is_specialization_of<std::tuple, meta::unqualified_t<T>>::value || meta::is_specialization_of<std::tuple, meta::unqualified_t<T>>::value
@ -662,9 +666,6 @@ namespace sol {
template <typename T> template <typename T>
struct is_proxy_primitive : is_lua_primitive<T> { }; struct is_proxy_primitive : is_lua_primitive<T> { };
template <typename T>
struct is_unique_usertype : std::integral_constant<bool, unique_usertype_traits<T>::value> {};
template <typename T> template <typename T>
struct is_transparent_argument : std::false_type {}; struct is_transparent_argument : std::false_type {};