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
Post a Comment