10 #include <luabind/iterator_policy.hpp>
14 LUABIND_ANONYMOUS_FIX
int feedback
= 0;
20 names
.push_back("first one");
21 names
.push_back("foobar");
22 names
.push_back("last one");
25 std::vector
<std::string
> names
;
28 } // anonymous namespace
32 using namespace luabind
;
34 lua_State
* L
= lua_open();
42 class_
<IteratorTest
>("A")
44 .def_readonly("names", &IteratorTest::names
, return_stl_iterator
)
47 dostring(L
, "a = A()");
48 dostring(L
, "b = ''");
49 dostring(L
, "for name in a.names do b = b .. name end");
51 if (object_cast
<std::string
>(get_globals(L
)["b"]) != "first onefoobarlast one") return false;