File tree Expand file tree Collapse file tree
include/boost/python/suite/indexing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ namespace boost { namespace python {
7878 elem_name += " _entry" ;
7979
8080 typedef typename mpl::if_<
81- is_class<data_type>
81+ mpl::and_< is_class<data_type>, mpl::bool_<!NoProxy> >
8282 , return_internal_reference<>
8383 , default_call_policies
8484 >::type get_data_return_policy;
@@ -98,7 +98,7 @@ namespace boost { namespace python {
9898
9999 static
100100 typename mpl::if_<
101- is_class<data_type>
101+ mpl::and_< is_class<data_type>, mpl::bool_<!NoProxy> >
102102 , data_type&
103103 , data_type
104104 >::type
Original file line number Diff line number Diff line change @@ -26,26 +26,6 @@ std::string x_value(X const& x)
2626 return " gotya " + x.s ;
2727}
2828
29-
30-
31- struct domain
32- {};
33-
34- struct graph
35- {
36- typedef std::map <int , boost::shared_ptr <domain> > domains_t ;
37- domains_t domains_;
38- };
39-
40-
41- // objects::class_value_wrapper <boost::shared_ptr<domain>,
42- // objects::make_ptr_instance <domain,
43- // objects::pointer_holder <boost::shared_ptr<domain>, domain> > > ();
44-
45-
46-
47-
48-
4929BOOST_PYTHON_MODULE (map_indexing_suite_ext)
5030{
5131 class_<X>(" X" )
@@ -74,20 +54,10 @@ BOOST_PYTHON_MODULE(map_indexing_suite_ext)
7454 ;
7555#endif
7656
77- // Compile check only. ..
57+ // Some more ..
7858 class_<std::map<std::string, boost::shared_ptr<X> > >(" TestMap" )
79- .def (map_indexing_suite<std::map<std::string, boost::shared_ptr<X> > >())
59+ .def (map_indexing_suite<std::map<std::string, boost::shared_ptr<X> >, true >())
8060 ;
81-
82- // Some more...
83- class_<domain, boost::shared_ptr <domain> > (" domain" );
84-
85- class_<graph::domains_t > (" domains_map" )
86- .def (map_indexing_suite<graph::domains_t , true > ());
87-
88- class_<graph> (" graph" )
89- .def_readonly (" domains" , &graph::domains_);
90-
9161}
9262
9363#include " module_tail.cpp"
Original file line number Diff line number Diff line change 191191# Some more...
192192#####################################################################
193193
194- >>> g = graph()
195- >>> for el in g.domains:
194+ >>> tm = TestMap()
195+ >>> tm["joel"] = X("aaa")
196+ >>> tm["kimpo"] = X("bbb")
197+ >>> print_xmap(tm)
198+ [ (joel, aaa) (kimpo, bbb) ]
199+ >>> for el in tm:
196200... print el.key(),
197201... dom = el.data()
202+ joel kimpo
198203
199204#####################################################################
200205# END....
You can’t perform that action at this time.
0 commit comments