D - more or less power than C++?

Dave Dave_member at pathlink.com
Sun Mar 5 14:04:56 PST 2006


In article <due89q$2c2b$1 at digitaldaemon.com>, Walter Bright says...
>
>
>"Jarrett Billingsley" <kb3ctd2 at yahoo.com> wrote in message 
>news:dudept$19qp$1 at digitaldaemon.com...
>> And in D, f(x) can be visually ambiguous as well - is the parameter in, 
>> out, or inout?
>
>At least you know it's a function call, rather than a declaration of x of 
>type f! 
>

Is this the primary reason that implicit ctors for fundamental types have not
been implemented?

If so, I guess I don't see how 'double i = double(10.25);' would be seen as any
more ambiguous or make code any harder to read than ctors or static opCalls for
UDT's?

With implicit fundamental types ctor syntax, 'static if(is(...))' wouldn't be
needed as much to support UDT's for templates like this (and also make template
code easier to develop, read and maintain, IMO):

//import std.math;
//template circumference(T)
//{
//    T circumference(T radius)
//    {
//        static if(is(T : real))
//            return PI * radius * 2;
//        else
//            return T(PI) * radius * T(2);
//    }
//}

Thanks,

- Dave





More information about the Digitalmars-d mailing list