[C++-sig] Boost-python wrapping a vector of vectors?

Tim Couper tim at tizmoi.net
Wed Jan 6 23:33:33 CET 2010


I'm trying to boost-python a vector-of-vectors, like

class A
{
public
    A(const std::vector<std::vector double >>& my_array);
};

and would intuitively write the wrapper:

BOOST_PYTHON_MODULE(foo)
{
using namespace boost::python

class_<A>("A")
     .def(init(std::vector<std::vector<double> >())
     ;

but get the error "a call to a constructor cannot appear in a constant 
expression"

Can anyone supply any guidance as to how to wrap this? Thanks

Tim

Dr Tim Couper

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20100106/3ee301ee/attachment.htm>


More information about the Cplusplus-sig mailing list