[luabind-cvs] luabind/luabind/luabind object.hpp,1.37,1.38
Brought to you by:
arvidn,
daniel_wallin
From: Daniel W. <dan...@us...> - 2005-12-16 18:52:32
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7869 Modified Files: object.hpp Log Message: Operators should only be enabled for object and it's proxy classes, not all value wrappers. Index: object.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- object.hpp 16 Dec 2005 17:51:47 -0000 1.37 +++ object.hpp 16 Dec 2005 18:52:23 -0000 1.38 @@ -92,16 +92,44 @@ namespace adl { - namespace mpl = boost::mpl; + template <class T> + class object_interface; + + namespace is_object_interface_aux + { + typedef char (&yes)[1]; + typedef char (&no)[2]; + + template <class T> + yes check(object_interface<T>*); + no check(void*); + + template <class T> + struct impl + { + BOOST_STATIC_CONSTANT(bool, value = + sizeof(is_object_interface_aux::check((T*)0)) == sizeof(yes) + ); + + typedef mpl::bool_<value> type; + }; + + } // namespace detail + + template <class T> + struct is_object_interface + : is_object_interface_aux::impl<T>::type + {}; + template <class R, class T, class U> struct enable_binary # ifndef BOOST_NO_SFINAE : boost::enable_if< mpl::or_< - is_value_wrapper<T> - , is_value_wrapper<U> + is_object_interface<T> + , is_object_interface<U> > , R > |