$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] [boost::python] iterator from member container
From: Ralf Goertz (R_Goertz_at_[hidden])
Date: 2011-01-17 11:57:44
Is ist possible to have a class that has a map as member like
struct Foo {
std::map<string,int> bar;
};
and then something like
class_<Foo>("Foo")
.def("__iter__", iterator<std::map<string,int>());
so that in python an object foo of type Foo can be used like this
for i in foo:
<do something with the bar iterator i>
?
Ralf