@@ -74,51 +74,51 @@ BOOST_PYTHON_MODULE_INIT(iterator_ext)
7474{
7575 module (" iterator_ext" )
7676 .def (" range" , &::range)
77- .add (
78- class_<list_int>(" list_int" )
79- .def (" push_back" , push_back)
80- .def (" back" , back)
81- .def (" __iter__" , iterator<list_int>())
82- )
83- .add (
84- class_<list_range>(" list_range" )
85-
86- // We can specify data members
87- .def (" __iter__"
88- , range (&list_range::first, &list_range::second))
89- )
90- .add (
91- class_<two_lists>(" two_lists" )
92-
93- // We can spcify member functions
94- .add_property (
95- " primes"
96- , range (&two_lists::one_begin, &two_lists::one_end))
97-
98- // Prove that we can explicitly specify call policies
99- .add_property (
100- " evens"
101- , range<return_value_policy<copy_non_const_reference> >(
102- &two_lists::two_begin, &two_lists::two_end))
103-
104- // Prove that we can specify call policies and target
105- .add_property (
106- " twosies"
107- , range<return_value_policy<copy_non_const_reference>, two_lists>(
108- // And we can use adaptable function objects when
109- // partial specialization is available.
77+ ;
78+
79+ class_<list_int>(" list_int" )
80+ .def (" push_back" , push_back)
81+ .def (" back" , back)
82+ .def (" __iter__" , iterator<list_int>())
83+ ;
84+
85+ class_<list_range>(" list_range" )
86+
87+ // We can specify data members
88+ .def (" __iter__"
89+ , range (&list_range::first, &list_range::second))
90+ ;
91+
92+ class_<two_lists>(" two_lists" )
93+
94+ // We can spcify member functions
95+ .add_property (
96+ " primes"
97+ , range (&two_lists::one_begin, &two_lists::one_end))
98+
99+ // Prove that we can explicitly specify call policies
100+ .add_property (
101+ " evens"
102+ , range<return_value_policy<copy_non_const_reference> >(
103+ &two_lists::two_begin, &two_lists::two_end))
104+
105+ // Prove that we can specify call policies and target
106+ .add_property (
107+ " twosies"
108+ , range<return_value_policy<copy_non_const_reference>, two_lists>(
109+ // And we can use adaptable function objects when
110+ // partial specialization is available.
110111# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
111- two_lists::two_start ()
112+ two_lists::two_start ()
112113# else
113- &two_lists::two_begin
114+ &two_lists::two_begin
114115# endif
115- , &two_lists::two_end))
116- )
117- .add (
118- class_<list_list>(" list_list" )
119- .def (" push_back" , push_list_back)
120- .def (" __iter__" , iterator<list_list,return_internal_reference<> >())
121- )
116+ , &two_lists::two_end))
117+ ;
118+
119+ class_<list_list>(" list_list" )
120+ .def (" push_back" , push_list_back)
121+ .def (" __iter__" , iterator<list_list,return_internal_reference<> >())
122122 ;
123123}
124124
0 commit comments