1313# include < boost/python/tuple.hpp>
1414
1515namespace boost { namespace python {
16-
16+
1717 // Forward declaration
1818 template <class Container , bool NoProxy, class DerivedPolicies >
1919 class map_indexing_suite ;
20-
20+
2121 namespace detail
2222 {
2323 template <class Container , bool NoProxy>
24- class final_map_derived_policies
25- : public map_indexing_suite<Container,
24+ class final_map_derived_policies
25+ : public map_indexing_suite<Container,
2626 NoProxy, final_map_derived_policies<Container, NoProxy> > {};
2727 }
2828
29- // The map_indexing_suite class is a predefined indexing_suite derived
29+ // The map_indexing_suite class is a predefined indexing_suite derived
3030 // class for wrapping std::vector (and std::vector like) classes. It provides
3131 // all the policies required by the indexing_suite (see indexing_suite).
3232 // Example usage:
@@ -43,11 +43,11 @@ namespace boost { namespace python {
4343 // disabled by supplying *true* in the NoProxy template parameter.
4444 //
4545 template <
46- class Container ,
46+ class Container ,
4747 bool NoProxy = false ,
48- class DerivedPolicies
48+ class DerivedPolicies
4949 = detail::final_map_derived_policies<Container, NoProxy> >
50- class map_indexing_suite
50+ class map_indexing_suite
5151 : public indexing_suite<
5252 Container
5353 , DerivedPolicies
@@ -57,9 +57,9 @@ namespace boost { namespace python {
5757 , typename Container::key_type
5858 , typename Container::key_type
5959 >
60- {
60+ {
6161 public:
62-
62+
6363 typedef typename Container::value_type value_type;
6464 typedef typename Container::value_type::second_type data_type;
6565 typedef typename Container::key_type key_type;
@@ -68,7 +68,7 @@ namespace boost { namespace python {
6868 typedef typename Container::difference_type difference_type;
6969
7070 template <class Class >
71- static void
71+ static void
7272 extension_def (Class& cl)
7373 {
7474 // Wrap the map's element (value_type)
@@ -81,21 +81,21 @@ namespace boost { namespace python {
8181 , return_internal_reference<>
8282 , default_call_policies
8383 >::type get_data_return_policy;
84-
84+
8585 class_<value_type>(elem_name.c_str ())
8686 .def (" __repr__" , &DerivedPolicies::print_elem)
8787 .def (" data" , &DerivedPolicies::get_data, get_data_return_policy ())
8888 .def (" key" , &DerivedPolicies::get_key)
8989 ;
9090 }
91-
91+
9292 static object
9393 print_elem (typename Container::value_type const & e)
9494 {
95- return " (%s, %s)" % make_tuple (e.first , e.second );
95+ return " (%s, %s)" % python:: make_tuple (e.first , e.second );
9696 }
9797
98- static
98+ static
9999 typename mpl::if_<
100100 is_class<data_type>
101101 , data_type&
@@ -112,9 +112,9 @@ namespace boost { namespace python {
112112 return e.first ;
113113 }
114114
115- static data_type&
115+ static data_type&
116116 get_item (Container& container, index_type i_)
117- {
117+ {
118118 typename Container::iterator i = container.find (i_);
119119 if (i == container.end ())
120120 {
@@ -124,39 +124,39 @@ namespace boost { namespace python {
124124 return i->second ;
125125 }
126126
127- static void
127+ static void
128128 set_item (Container& container, index_type i, data_type const & v)
129- {
129+ {
130130 container[i] = v;
131131 }
132132
133- static void
133+ static void
134134 delete_item (Container& container, index_type i)
135- {
135+ {
136136 container.erase (i);
137137 }
138-
138+
139139 static size_t
140140 size (Container& container)
141141 {
142142 return container.size ();
143143 }
144-
144+
145145 static bool
146146 contains (Container& container, key_type const & key)
147147 {
148148 return container.find (key) != container.end ();
149149 }
150-
151- static bool
150+
151+ static bool
152152 compare_index (Container& container, index_type a, index_type b)
153153 {
154154 return container.key_comp ()(a, b);
155155 }
156-
156+
157157 static index_type
158158 convert_index (Container& container, PyObject* i_)
159- {
159+ {
160160 extract<key_type const &> i (i_);
161161 if (i.check ())
162162 {
@@ -174,7 +174,7 @@ namespace boost { namespace python {
174174 return index_type ();
175175 }
176176 };
177-
178- }} // namespace boost::python
177+
178+ }} // namespace boost::python
179179
180180#endif // MAP_INDEXING_SUITE_JDG20038_HPP
0 commit comments