[C++-sig] Re: std::complex<double>?

David Abrahams dave at boost-consulting.com
Fri Jan 9 19:39:11 CET 2004


"Neal D. Becker" <nbecker at hns.com> writes:

>>From reading the docs, I got the idea that to_python_converter
> should work. 

The library is already handling std::complex<double>.
It will work for std::complex<int>, but then you need the other part
of the equation: something in the indexing suite to say that the
vector's values need to be returned by value and not by reference.

>
> 1. I don't know why this doesn't work.
> 2. I don't know if this has the right semantics.  I want the python complex
> value to be a reference to the c++ one.

No you don't; trust me ;-)

There isn't really a good way to do that, since the library already
has decided that std::complex<double> becomes a Python complex object.

> Am I on the correct track here?  Can anyone give me a clue?

Been trying?  How'm I doing?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list