[C++-sig] Re: std::complex<double>?
Neal D. Becker
nbecker at hns.com
Fri Jan 9 16:13:21 CET 2004
Jonathan Brandmeyer wrote:
> On Fri, 2004-01-09 at 08:07, Neal D. Becker wrote:
>> How do I reflect std::complex<double> into python?
>
> Well, there isn't any prebuilt suite for exporting that type to Python,
> so you would have to write something along the lines of
>
> template<typename T>
> void
> wrap_std_complex( std::string name)
> {
> class_<std::complex<T> >(name, init<T, optional<T> >())
> .def( "imag", &std::complex<T>::imag)
> .def( self + self)
> // ... and so on and so forth
> ;
> }
>
Thanks so much for your reply. I am an amateur at this - what documents can
I find that would help me to complete the above outlined example?
More information about the Cplusplus-sig
mailing list