[luabind-cvs] luabind/luabind/luabind object.hpp,1.40,1.41
Brought to you by:
arvidn,
daniel_wallin
From: Arvid N. <ar...@us...> - 2006-09-01 13:06:26
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv26523/luabind Modified Files: object.hpp Log Message: fixed assignment operator on index_proxy to accept an index proxy of the same type. i.e. expressions like table[x] = table[y] did not work previously. Index: object.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- object.hpp 13 Jun 2006 23:27:57 -0000 1.40 +++ object.hpp 1 Sep 2006 13:06:23 -0000 1.41 @@ -614,6 +614,17 @@ return *this; } + this_type& operator=(this_type 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); + detail::push(m_interpreter, value); + lua_settable(m_interpreter, -3); + return *this; + } + template<class T> index_proxy<this_type> operator[](T const& key) { @@ -630,7 +641,7 @@ private: struct hidden_type {}; - this_type& operator=(index_proxy<Next> const&); +// this_type& operator=(index_proxy<Next> const&); mutable lua_State* m_interpreter; int m_key_index; |