Revision 1 as of 2002-09-26 18:28:53

Clear message

Iterators

Python iterator support a highly flexible interface allowing:

    ...
    .def("__iter__", iterator<list_int>())

    ...
    .def("__iter__"
         , range(&my_class::x_begin, &my_class::x_end))
    )

    ...
    .def("__iter__"
         , range(&std::pair<char*,char*>::first, &std::pair<char*,char*>::second))
    )

    ...
    .def("__iter__", 
         , range<return_value_policy<copy_non_const_reference> >(
               &my_sequence<heavy>::begin
             , &my_sequence<heavy>::end))

Unable to edit the page? See the FrontPage for instructions.