References in D

Namespace rswhite4 at googlemail.com
Sat Sep 15 05:57:34 PDT 2012


That is the one thing I miss also.
The solution until now is to use a wrapper struct around a class, 
but that is _very_ annoying and a good language should have 
something on their own.

But it is right, for D2 this mistake is going to long as you can 
change it so soon.
But maybe a Syntax like in C++ could help: If you want a not 
nullable reference use &: void foo(Foo& f) { and if you want a 
nullable Reference do nothing extra.
I still work on a (pre)compiler that converts statements like 
Foo& f into Ref!Foo but I think D should do this on their own.


More information about the Digitalmars-d mailing list