More than one invariant per struct/class
Pelle
pelle.mansson at gmail.com
Sun Aug 7 23:23:36 PDT 2011
On Sat, 06 Aug 2011 22:53:31 +0200, Jonathan M Davis <jmdavisProg at gmx.com>
wrote:
> Feel free to create a feature request on it. It may even get the language
> changed. However, having more than one invariant complicates things a
> bit,
> since right now, it's easy for the runtime to just call the one
> invariant. If
> you had multiple invariants, they would have to be merged somehow by the
> compiler. It's completely doable, but it definitely complicates things,
> which
> is probably why it doesn't work that way now.
unittests are already merged this way, so it should be easy.
More information about the Digitalmars-d-learn
mailing list