[luabind] luabind and std::multimap
Brought to you by:
arvidn,
daniel_wallin
From: irukandji <iru...@vo...> - 2012-02-14 12:49:07
|
Hi everyone, sorry for sending this mail but i wasnt able to find the answer anywhere else. I dont want to make a wrapper around multimap or convert the data to a table as this brings useless copying of data, so the idea was to export the std::pair class and use it as it is from multimap iterators. The ::first is working just fine and outputs the data stored as a key, but the ::second fails and i am unable to figure out why. Can anyone maybe at least say that this is not possible so i can stop banging my head against the wall? :) Thank you in advance... // c++ part std::multimap<std::string, std::string> m_multimap; luabind::module(pLuaState) [ luabind::class_< std::pair<const std::string, std::string> > ("MultimapPair") .property("key", &std::pair<const std::string, std::string>::first ) .property("val", &std::pair<const std::string, std::string>::second ) ]; luabind::module(pLuaState) [ luabind::class_<CTest>("CTest") .def_readwrite("multimap", &CTest::m_multimap, luabind::return_stl_iterator) ]; // luapart function testclass( ctest ) for data in ctest.multimap do trace(data.key) trace(data.value) end end |