Adding an overload for the assignment operator in lua for luabind classes
Lua does not allow the assignment operator to be overloaded and has no meta function for it. I have got around this by using the proxy pattern and the __index/__newindex meta methods.
Now I have begun using classes defined via luabind's object oriented system thats exposed to Lua.
I am wondering if the C++ code for Luabind can be changed to allow the assignment operator to be overloaded without changing the code for the Lua interpretor itself.
Perhaps such a overload would call into a new meta-method name thats not used by Lua such as '__assign()'
This would not conflict with any meta method that Lua already uses and would apply only to instances of luabind classes.
I am guessing that the luabind::adl::object class needs to be changed, or perhaps index_proxy. But I am not sufficiently familiar with how luabind forwards calls to existing Lua meta-methods, to its objects.
Has anyone explored the C++ code in luabind that supports operator overloading in Lua?