From 2e0789c166f3200962dd03a64faae5e9a02687e6 Mon Sep 17 00:00:00 2001 From: Daniel Wallin Date: Fri, 16 Dec 2005 18:52:23 +0000 Subject: [PATCH] Operators should only be enabled for object and it's proxy classes, not all value wrappers. --- luabind/object.hpp | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/luabind/object.hpp b/luabind/object.hpp index 1c8596c..e6be755 100644 --- a/luabind/object.hpp +++ b/luabind/object.hpp @@ -92,16 +92,44 @@ namespace detail namespace adl { - namespace mpl = boost::mpl; + template + class object_interface; + + namespace is_object_interface_aux + { + typedef char (&yes)[1]; + typedef char (&no)[2]; + + template + yes check(object_interface*); + no check(void*); + + template + struct impl + { + BOOST_STATIC_CONSTANT(bool, value = + sizeof(is_object_interface_aux::check((T*)0)) == sizeof(yes) + ); + + typedef mpl::bool_ type; + }; + + } // namespace detail + + template + struct is_object_interface + : is_object_interface_aux::impl::type + {}; + template struct enable_binary # ifndef BOOST_NO_SFINAE : boost::enable_if< mpl::or_< - is_value_wrapper - , is_value_wrapper + is_object_interface + , is_object_interface > , R > -- 2.11.4.GIT