push_reference should respect unique usertypes

This commit is contained in:
ThePhD 2016-08-21 19:24:26 -04:00
parent ec97dac651
commit 6243cbe103
3 changed files with 9 additions and 8 deletions

View File

@ -20,8 +20,8 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// This file was generated with a script.
// Generated 2016-08-20 01:43:43.958063 UTC
// This header was generated with sol v2.11.5 (revision fd657ea)
// Generated 2016-08-21 23:23:21.515644 UTC
// This header was generated with sol v2.11.5 (revision ec97dac)
// https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_HPP
@ -3426,6 +3426,9 @@ namespace sol {
struct accumulate<C, v, V, T, Args...> : accumulate<C, v + V<T>::value, V, Args...> {};
} // detail
template <typename T>
struct is_unique_usertype : std::integral_constant<bool, unique_usertype_traits<T>::value> {};
template <typename T>
struct lua_type_of : detail::lua_type_of<T> {};
@ -3468,9 +3471,6 @@ namespace sol {
template <typename 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>
struct is_transparent_argument : std::false_type {};
@ -3967,7 +3967,8 @@ namespace sol {
typedef meta::all<
std::is_lvalue_reference<T>,
meta::neg<std::is_const<T>>,
meta::neg<is_lua_primitive<meta::unqualified_t<T>>>
meta::neg<is_lua_primitive<meta::unqualified_t<T>>>,
meta::neg<is_unique_usertype<T>>
> use_reference_tag;
return pusher<std::conditional_t<use_reference_tag::value, detail::as_reference_tag, meta::unqualified_t<T>>>{}.push(L, std::forward<T>(t), std::forward<Args>(args)...);
}

View File

@ -160,7 +160,8 @@ namespace sol {
typedef meta::all<
std::is_lvalue_reference<T>,
meta::neg<std::is_const<T>>,
meta::neg<is_lua_primitive<meta::unqualified_t<T>>>
meta::neg<is_lua_primitive<meta::unqualified_t<T>>>,
meta::neg<is_unique_usertype<T>>
> use_reference_tag;
return pusher<std::conditional_t<use_reference_tag::value, detail::as_reference_tag, meta::unqualified_t<T>>>{}.push(L, std::forward<T>(t), std::forward<Args>(args)...);
}

View File

@ -639,7 +639,6 @@ namespace sol {
struct is_lua_primitive : std::integral_constant<bool,
type::userdata != lua_type_of<meta::unqualified_t<T>>::value
|| (lua_size<T>::value > 1)
|| is_unique_usertype<T>::value
|| std::is_base_of<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