decimad / luabind-deboostified

Create Lua bindings for your C++ code easily - my improvements
http://www.vrac.iastate.edu/vancegroup/docs/luabind/
Other
70 stars 27 forks source link

now we can get upvalue name + build with for LUABIND_NO_EXCEPTIONS mode #19

Closed bagobor closed 8 years ago

bagobor commented 8 years ago

Sorry for second fix in single pull request. (It was automatically added as I pushed new fix to my fork.)

nitrocaster commented 8 years ago

Why don't you provide a test for this feature?

upd: nevermind, I misread the message.

bagobor commented 8 years ago

@nitrocaster FYI :santa: Sample code for upvalue name ( I used it to avoid chunk recompilation in my scripted entity system):

    luaL_loadstring(L,script.c_str());
    luabind::object compiledScript(luabind::from_stack(L, -1));

    for (int index = 1;;++index) { 
        auto upv = luabind::getupvalue(compiledScript, index);
        auto name = std::get<0>(upv);
        if (!name) break;
        std::cout << name << endl;
    }
nitrocaster commented 8 years ago

Looks reasonable for me. @decimad, how about merge?

decimad commented 8 years ago

There we go! Thank you!