Request: (T) == T

Janice Caron caron800 at googlemail.com
Mon Dec 10 02:51:37 PST 2007


Wherever T is a type expression, please could (T) also be a type
expression, evaluating to T. That is, please could (T) be made to
compile, as if the brackets weren't there. For example, let

    (int) x;

be the same thing as

    int x;

declaring x to be an int, and let

    (int)[] p;

be the same thing as

    int[] p;

declaring p to be an array of ints. For that matter ((((T)))) should
also evaluate to T, and const(const(T)) should evaluate to const(T),
and so on.

This would be useful for generic programming, mixin strings, etc.



More information about the Digitalmars-d mailing list