Nullable!T

Clemens eriatarka84 at gmail.com
Wed Jul 7 06:11:12 PDT 2010


Adam Ruppe Wrote:

> On 7/7/10, Clemens <eriatarka84 at gmail.com> wrote:
> > Strange... I could have sworn that when I recently tried D2, arrays
> > supported range methods (popFront etc), and that those were implemented in
> > std.array. Am I mistaken, or how does that work?
> 
> Arrays work for it, and have for quite a while, but nothing else does
> yet; it doesn't work with classes and pointers, which are the other
> important built-in nullables.

Now that you mention it, yes, that sounds familiar.

That brings up an interesting corner case though: once uniform call syntax is supported for pointers and references, and you have a null reference x, an actual method x.foo() would give you a segmentation fault, while a pseudomethod that is implemented as a free function could have the same call syntax, x.foo(), but could potentially work even for null references. Correct?

Not saying it's necessarily a problem, just slightly unexpected.


More information about the Digitalmars-d mailing list