Nullable or Optional? Or something else?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Sep 11 08:20:03 PDT 2009


Steven Schveighoffer wrote:
> On Thu, 10 Sep 2009 17:41:19 -0400, Rainer Deyke <rainerd at eldwood.com> 
> wrote:
>> Proxies, especially proxies that add functionality to their base type,
>> cannot act exactly like the type they are proxying.  Using a proxy
>> therefore requires the significant mental overhead of keeping track of
>> all the corner cases in which the proxy does not act like the type it is
>> proxying, as well as the hassle of working around those limitation
>> whenever they come up.
> 
> They can act like the base type up to a point.  You make it sound like a 
> chore to use a wrapper type, but the truth is they are easy to use, 
> there are not that many cases to worry about.

My experience with wrappers in C++ has been similar to Rainer's. 
Essentially you can't define "smart references" in C++. I hope we were 
or will be able to fix that with the "alias this" feature.

Andrei



More information about the Digitalmars-d mailing list