2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-26 06:42:27 +00:00

Add explicit algo and traits selection when no partial template specializations

[SVN r20312]
This commit is contained in:
Raoul Gough
2003-10-08 17:59:27 +00:00
parent 4eb977b511
commit 9c773b5387

View File

@@ -51,13 +51,25 @@ BOOST_PYTHON_MODULE(testnonlinear)
;
typedef std::map<std::string, IntWrapper> Container1;
boost::python::class_<Container1>("Map")
.def (boost::python::indexing::container_suite<Container1>());
typedef std::set<std::string> Container2;
boost::python::class_<Container2>("Set")
.def (boost::python::indexing::container_suite<Container2>());
#if !BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
typedef boost::python::indexing::container_suite<Container1> Suite1;
typedef boost::python::indexing::container_suite<Container2> Suite2;
#else
typedef boost::python::indexing::container_suite
<Container1
, boost::python::indexing::map_algorithms
<boost::python::indexing::map_traits
<Container1> > > Suite1;
typedef boost::python::indexing::container_suite
<Container2
, boost::python::indexing::set_algorithms
<boost::python::indexing::set_traits
<Container2> > > Suite2;
#endif
boost::python::class_<Container1>("Map").def (Suite1());
boost::python::class_<Container2>("Set").def (Suite2());
}