References in D

Henning Pohl henning at still-hidden.de
Sat Sep 15 15:42:05 PDT 2012


On Saturday, 15 September 2012 at 21:30:03 UTC, Walter Bright 
wrote:
> On 9/15/2012 5:39 AM, Henning Pohl wrote:
>> The way D is dealing with classes reminds me of pointers 
>> because you can null
>> them. C++'s references cannot (of course you can do some nasty 
>> casting).
>
> Doing null references in C++ is simple:
>
> int *p = NULL;
> int& r = *p;
>
> r = 3; // crash

Next time I think before I write.


More information about the Digitalmars-d mailing list