[C++-sig] boost python writing converters for list to std::vector<T>

Helfer Thomas helferthomas at free.fr
Fri Apr 20 17:45:37 CEST 2012


Hi,

using
http://misspent.wordpress.com/2009/09/27/how-to-write-boost-python-converters/, I tried to write a converter for list to std::vector<T> (In the example, T will be double).

The code (see converter.cxx) I wrote is still in early stage of
development (no check) but compiles fine on ubuntu oneiric with boost
python 1.46. I used it to create an std module. However, a simple test
(see test.py) does not work as exepted.

Did I misunderstood something or does boost have a special treatment for
the list object which bypasses converters ? 

Thanks for any help,

Sincerly,

Helfer THomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: converter.cxx
Type: text/x-c++src
Size: 2663 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20120420/ee2d3688/attachment.cxx>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: text/x-python
Size: 33 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20120420/ee2d3688/attachment.py>


More information about the Cplusplus-sig mailing list