1 #ifndef OST_EXPORT_HELPER_VECTOR_HH
2 #define OST_EXPORT_HELPER_VECTOR_HH
4 #include <boost/python/def_visitor.hpp>
5 #include <boost/python/suite/indexing/container_utils.hpp>
12 namespace bp=boost::python;
13 template <
typename Container>
15 public bp::def_visitor<VectorAdditions<Container> > {
19 template <
class Class>
23 .def(
"__str__", &to_string)
24 .def(
"__init__", make_constructor(&from_iter))
28 static boost::shared_ptr<Container> from_iter(
const bp::object& obj)
30 boost::shared_ptr<Container> c(
new Container);
31 bp::container_utils::extend_container(*c.get(), obj);
35 static std::string to_string(Container& cl)
40 for (
typename Container::const_iterator
41 i=cl.begin(), e=cl.end(); i!=e; ++i) {
void visit(Class &cl) const
Container::value_type value_type