NotNull pointers
Timon Gehr
timon.gehr at gmx.ch
Wed Aug 31 14:37:04 PDT 2011
On 08/31/2011 11:24 PM, Christophe wrote:
> Maybe think assert should not be rewritten, but opCast!(bool) should
> test if the class reference is null, which would be consistent with
> opEquals
It actually does:
class C;
C x;
// assert(x&&1); // no segfault
assert(x); // segfault
The problem is that assert(classref); is special cased to segfault on
invalid class references.
More information about the Digitalmars-d
mailing list