More than one invariant per struct/class
Pelle
pelle.mansson at gmail.com
Thu Aug 4 03:48:10 PDT 2011
On Thu, 04 Aug 2011 12:40:48 +0200, simendsjo <simendsjo at gmail.com> wrote:
> On 04.08.2011 12:30, Pelle wrote:
>> What happens if you replace assert(_c) with assert(_c !is null)?
>
> The problem is that you cannot include more than one invariant() in a
> struct or class.
IIRC assert(obj) gets rewritten to obj.__invariant() or something like
that, which segfaults if obj is null. I thought that maybe that was why
the code didn't work. :--)
More information about the Digitalmars-d-learn
mailing list