Why typedef's shouldn't have been removed :(

Timon Gehr timon.gehr at gmx.ch
Fri May 11 16:30:14 PDT 2012


On 05/11/2012 10:14 PM, Andrej Mitrovic wrote:
> On 5/11/12, Steven Schveighoffer<schveiguy at yahoo.com>  wrote:
>> Since null is its own type now..
>
> What were the use-cases for making it a type? Seems odd to declare it:
> typeof(null) x;
>
> I mean what could you do with such a type?


eg. IFTI.

Object x;

void foo(T)(T arg){ x = arg; }

void main(){
     foo(null);
}

This didn't work when null was of type void*.
Unfortunately, there isn't a typeof([]).


More information about the Digitalmars-d mailing list