Nullable or Optional? Or something else?
Danny Wilson
bluezenix at gmail.com
Wed Sep 2 14:16:36 PDT 2009
Op Wed, 02 Sep 2009 22:55:53 +0200 schreef Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org>:
>> So if pointers wouldn't be considered evil, Maybe!T* would suffice?
>> Can someone point me out what the big difference is between ref and
>> simply disallowing pointer arithmitic? Is it marketing?
>
> Ref means lvalue of type T. Pointer is a type distinct from T. So
> although NullableRef!T is substitutable for an lvalue of type T,
> Nullable!(T*) is not.
>
>
> Andrei
Thanks. I googled first but couldn't find some explicit documentation
about 'ref' just it being mentioned here and there :-)
Are there any problems with something like:
Nullable!(ref T)
?
More information about the Digitalmars-d
mailing list