I'm new to this list and apologize if this has been already discussed
(I didn't find any reference).
Basically, I'd like to be able to access in read/write to global
objects or object properties in a way like get(luaState, "MyGlobal") =
123. However, I incur in crashes or panic(). Digging into the luabind
code, I suspect there is some problem in transferring ownership
between adl::index_proxy instances, it's like the stack is not
Or I am completely wrong :)
I set up the following code that explains the problem better than I could:
As you can see from the comments, panic occurs in cases 4, 5, and 6.
In particular, what cause myself to raise the white flag is that case
3 works and case 4 does not.
What I was originally trying to accomplish is some wrapper class that
allows me to do something like:
LuaState lua; // takes care of creating the C lua state, init luabind etc.
lua["X"] = 1;
As you can imagine, overloading operator  is the point in question,
so I wrote the above use cases to try to focus the problem. It seems
to me that the copy constructor of index_proxy is not correctly
managing the stack. Using references on returned l-values is not an
option because of the proxies are temporary. neither casting
index_proxy to object helps because of the lack of the assign operator
in the object class.