UFCS with constructors

bearophile bearophileHUGS at lycos.com
Wed Nov 6 06:54:51 PST 2013


qznc:

> Operator precedence of "." is higher than unary minus.

Is this good?


> However, what is Typedef for?

It's to create a differently named type, useful for stronger 
static typing, to increase code clarity and avoid some bugs.

If you have a function like this:

double foo(in double x, in double k) pure nothrow

You can give it swapped arguments (also because D still lacks 
named arguments). But if you define a:

alias Coordinate = Typedef!double;
Coordinate foo(in Coordinate x, in double k) pure nothrow

You will have less mistakes.

Currently Typedef has some bugs.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list