Struct with default ctor (Was: [dmd-beta] dmd 2.064 beta take 2)
Walter Bright
newshound2 at digitalmars.com
Sun May 19 11:23:21 PDT 2013
On 5/19/2013 5:02 AM, Simen Kjaeraas wrote:
>> By definition? Pointer semantics are what we choose it to mean.
> Of course. But which definition is saner:
For many types, it is extremely useful to have some sort of "invalid" value for
it. null fills that role nicely for pointers, just as nan does for floating
point types, and 0xFF does for UTF-8.
There's not anything insane about it. The Nullable type constructor even exists
in order to provide such an invalid state for types (like int) which normally do
not have one.
Yes, I do understand there's a role for pointers which cannot hold the invalid
value.
More information about the Digitalmars-d
mailing list