www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - A small difference between cdouble and std.complex

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
Nov 18 2013