A small difference between cdouble and std.complex

bearophile bearophileHUGS at lycos.com
Mon Nov 18 07:20:40 PST 2013


This shows a difference between the deprecated built-in complex 
numbers and std.complex:


void main() {
     import std.complex: complex;
     const cdouble cd;
     pragma(msg, typeof(cd.re));
     const acc = complex(1, 2);
     pragma(msg, typeof(acc.re));
}

It prints:

double
const(double)

Is such difference important and worth fixing?
It has caused a small problem when I have ported some code from 
cdouble to Complex, that contained typeof(data[0].re)  where data 
was a cdouble[].

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list