|
Boost : |
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-11-16 15:03:57
Hi Paul,
The first question for you to answer is, "which Python types am I expecting
to be usable as legitimate 2nd arguments to this function?". For a function
taking a non-const reference to a vector<double>, your choices are quite
limited: you'll need to expose vector<double> in your extension module just
as though it were one of your own classes. If the reference were const or
the parameter were passed by value, you could write a from_python(PyObject*,
type<std::vector<double> const&>) function which converts, say, Python
tuples and lists to C++ vectors of double.
HTH,
Dave
----- Original Message -----
From: "Paul F. Kunz" <paul_kunz_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, November 16, 2001 11:54 AM
Subject: [boost] boost/python question on handling STL vector
> I've started using boost/python (great product) and have run into
> one problem that I can't find help for in the documentation. How to
> I interface to a member function of a class whose signature is...
>
> addColumn ( const std::string & label, std::vector< double > & );
>
> Its the second argument that has me stuck.
>
>
> Info: http://www.boost.org Unsubscribe:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk