NaNs Just Don't Get No Respect
Simen Kjaeraas
simen.kjaras at gmail.com
Sun Aug 19 14:41:58 PDT 2012
On Sun, 19 Aug 2012 22:18:37 +0200, Walter Bright
<newshound2 at digitalmars.com> wrote:
> On 8/19/2012 5:08 AM, bearophile wrote:
>> With a different type system the compiler makes sure at compile-time
>> that x is
>> not empty (this means the compiler makes sure in no code paths x is
>> used before
>> testing it contains something), avoiding the run-time exception.
>
> That's called disabling the default constructor with @disable.
Nope. What bearophile is talking about is something more akin to this,
I think:
Nullable!int a;
int x = a; // Compile-time error: a might be null!
if ( a ) {
int y = a; // 's fine, we know it's not null.
}
--
Simen
More information about the Digitalmars-d-announce
mailing list