Lisandro Dalcin wrote:

> On Tue, Oct 6, 2009 at 11:47 AM, Neal Becker
> <ndbeck...@gmail.com> wrote:
>>>
>>> Yes, but C99 complexes could be used in C++ (for example, IBM
>>> compilers seems to let you use C99 complexes in C++, look at the very
>>> end of:
>>>
>> 
http://publib.boulder.ibm.com/infocenter/comphelp/v7v91/index.jsp?topic=/com.ibm.vacpp7a.doc/language/ref/clrc03complex_types.htm)
>>>
>> I'm pretty sure gcc won't allow this.
>>
> 
> OK. Now I've actually read the C++0x draft, and it seems that the C99
> complexes will not be supported (am I right here)? In such case, now
> it is pretty clear what to do: by default, Cython uses the
> struct-based complex, and with an appropriate directive (we should
> rename c99_complex to something more language-agnostic, right?) Cython
> switches to use C99 complexes in case of C compilation, and C++
> complexes in case of C++ compilation.
> 

Keep in mind that c++ complex != c99 complex.  Specifically, you cannot just 
get/put values using:

double y = z.imag <NO
z.imag = 2 <NO

The portable way is:
double y = z.imag() or imag (z) <get the value
z.imag(2) <set the value

_______________________________________________
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to