Exemplo n.º 1
0
 // Extract an object x of the Target type from the first Python
 // argument, and invoke get_start(x)/get_finish(x) to produce
 // iterators, which are used to construct a new iterator_range<>
 // object that gets wrapped into a Python iterator.
 iterator_range<NextPolicies,Iterator>
 operator()(back_reference<Target&> x) const
 {
     // Make sure the Python class is instantiated.
     detail::demand_iterator_class("iterator", (Iterator*)0, NextPolicies());
     
     return iterator_range<NextPolicies,Iterator>(
         x.source()
       , m_get_start(x.get())
       , m_get_finish(x.get())
     );
 }
Exemplo n.º 2
0
// prove that back_references get initialized with the right PyObject*
object y_identity(back_reference<Y const&> y)
{
    return y.source();
}