Is the other-kind-of-null really necessary in Nullable and Variant?
Idan Arye
GenericNPC at gmail.com
Mon Apr 29 13:04:00 PDT 2013
On Monday, 29 April 2013 at 20:00:32 UTC, Idan Arye wrote:
>
> The init value of `Nullable!(Node!string)` is an object with
> two member fields - `value` of type `string` and `next` of type
> `Nullable!(Node!string)`. The default constructor modifies
> neither, so they will both remain with their initial values.
> The init value of `string` is an empty string. What is the init
> value of `Nullable!(Node!string)`? To find the answer, return
> to the beginning of this paragraph and read it again.
I made a mistake here - `Nullable!(Node!string)` is a struct with
a boolean member `_isNull` and a `Node!string` member named
`_value` which is an object as described in this paragraph.
Still, the point remains - even if `_isNull` is true, `_value`
still need to refer to a `Node!string` object.
More information about the Digitalmars-d
mailing list