c++ - Luabind: return_stl_iterator for std::map -


is there way return stl iterator std::map (e.g. std::map<const std::string, int>)?

luabind definition example class:

class_<someclass>( "someclass" )   .property( "items", &someclass::getitems, return_stl_iterator ) 

getitems() returns const reference std::map container.

when accessing in lua this:

for item in some_class.items   ... end 

luabind throws std::runtime_error saying "trying use unregistered class". iterating on std::maps not possible? (the documentation says containers having begin() , end() work...)

perhaps "unregistered class" std::pair<const std::string, int>. can try registering luabind , see if works then?


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -