[luabind-cvs] luabind/luabind/luabind object.hpp,1.34.2.18,1.34.2.19
Brought to you by:
arvidn,
daniel_wallin
From: Daniel W. <dan...@us...> - 2005-10-19 16:27:46
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25228 Modified Files: Tag: beta7-devel2 object.hpp Log Message: Overload resolution fix for VC6.5. Index: object.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v retrieving revision 1.34.2.18 retrieving revision 1.34.2.19 diff -u -d -r1.34.2.18 -r1.34.2.19 --- object.hpp 19 Oct 2005 11:49:02 -0000 1.34.2.18 +++ object.hpp 19 Oct 2005 16:27:33 -0000 1.34.2.19 @@ -567,22 +567,19 @@ namespace adl { - // An object holds a reference to a Lua value residing - // in the registry. - class object : public object_interface<object> + class object_init { - struct safe_bool_type {}; - public: - object() + protected: + object_init() {} - - explicit object(from_stack const& stack_reference) + + explicit object_init(from_stack const& stack_reference, boost::mpl::true_) : m_handle(stack_reference.interpreter, stack_reference.index) { } template<class ValueWrapper> - explicit object(ValueWrapper const& value_wrapper) + explicit object_init(ValueWrapper const& value_wrapper, boost::mpl::false_) { lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter( value_wrapper @@ -594,6 +591,31 @@ handle(interpreter, -1).swap(m_handle); } + handle m_handle; + }; + + // An object holds a reference to a Lua value residing + // in the registry. + class object : object_init, public object_interface<object> + { + struct safe_bool_type {}; + public: + object() + {} + +#if !BOOST_WORKAROUND(BOOST_MSVC, == 1200) + explicit object(from_stack const& stack_reference) + : object_init(stack_reference, boost::mpl::true_()) + { + } +#endif + + template<class ValueWrapper> + explicit object(ValueWrapper const& value_wrapper) + : object_init(value_wrapper, boost::is_same<ValueWrapper,from_stack>()) + { + } + template<class T> object(lua_State* interpreter, T const& value) { @@ -629,7 +651,6 @@ } private: - handle m_handle; }; inline void object::push(lua_State* interpreter) const |