[luabind-cvs] luabind/luabind/luabind object.hpp,1.34.2.19,1.34.2.20
Brought to you by:
arvidn,
daniel_wallin
From: Daniel W. <dan...@us...> - 2005-10-22 10:31:32
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10658 Modified Files: Tag: beta7-devel2 object.hpp Log Message: Fixed ICE on VC6.0. Index: object.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v retrieving revision 1.34.2.19 retrieving revision 1.34.2.20 diff -u -d -r1.34.2.19 -r1.34.2.20 --- object.hpp 19 Oct 2005 16:27:33 -0000 1.34.2.19 +++ object.hpp 22 Oct 2005 10:31:19 -0000 1.34.2.20 @@ -52,7 +52,7 @@ { typedef typename boost::mpl::if_< boost::is_reference_wrapper<T> - , typename boost::unwrap_reference<T>::type& + , BOOST_DEDUCED_TYPENAME boost::unwrap_reference<T>::type& , T >::type unwrapped_type; @@ -63,7 +63,9 @@ cv.apply( interpreter - , boost::implicit_cast<typename boost::unwrap_reference<T>::type&>(value) + , boost::implicit_cast< + BOOST_DEDUCED_TYPENAME boost::unwrap_reference<T>::type& + >(value) ); } @@ -482,7 +484,6 @@ this_type& operator=(T const& value) { value_wrapper_traits<Next>::unwrap(m_interpreter, m_next); - detail::stack_pop pop(m_interpreter, 1); lua_pushvalue(m_interpreter, m_key_index); @@ -596,23 +597,19 @@ // An object holds a reference to a Lua value residing // in the registry. - class object : object_init, public object_interface<object> + class object : 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 + explicit object(handle const& other) + : m_handle(other) + {} - template<class ValueWrapper> - explicit object(ValueWrapper const& value_wrapper) - : object_init(value_wrapper, boost::is_same<ValueWrapper,from_stack>()) + explicit object(from_stack const& stack_reference) + : m_handle(stack_reference.interpreter, stack_reference.index) { } @@ -651,6 +648,7 @@ } private: + handle m_handle; }; inline void object::push(lua_State* interpreter) const @@ -741,12 +739,14 @@ , class ValueWrapper , class Policies , class ErrorPolicy + , class ReturnType > - typename ErrorPolicy::type object_cast_aux( + ReturnType object_cast_aux( ValueWrapper const& value_wrapper , T* , Policies* , ErrorPolicy* + , ReturnType* ) { lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter( @@ -785,8 +785,6 @@ template<class T> struct throw_error_policy { - typedef T type; - static T handle_error(lua_State* interpreter, LUABIND_TYPE_INFO type_info) { #ifndef LUABIND_NO_EXCEPTIONS @@ -805,11 +803,9 @@ template<class T> struct nothrow_error_policy { - typedef boost::optional<T> type; - - static type handle_error(lua_State*, LUABIND_TYPE_INFO) + static boost::optional<T> handle_error(lua_State*, LUABIND_TYPE_INFO) { - return type(); + return boost::optional<T>(); } }; @@ -823,6 +819,7 @@ , (T*)0 , (detail::null_type*)0 , (detail::throw_error_policy<T>*)0 + , (T*)0 ); } @@ -834,6 +831,7 @@ , (T*)0 , (Policies*)0 , (detail::throw_error_policy<T>*)0 + , (T*)0 ); } @@ -845,6 +843,7 @@ , (T*)0 , (detail::null_type*)0 , (detail::nothrow_error_policy<T>*)0 + , (boost::optional<T>*)0 ); } @@ -856,18 +855,13 @@ , (T*)0 , (Policies*)0 , (detail::nothrow_error_policy<T>*)0 + , (boost::optional<T>*)0 ); } namespace detail { - template<class T> - void convert_to_lua(lua_State*, const T&); - - template<int Index, class T, class Policies> - void convert_to_lua_p(lua_State*, const T&, const Policies&); - template<int Index> struct push_args_from_tuple { |