www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - When is invariant created?

reply Ant <duitoolkit yahoo.ca> writes:
I don't have any invariant on my classes
however all the methods make a call to 

_D9invariant12_d_invariantFC6ObjectZv

and a loop is executed there

what's that for?

Ant
Sep 20 2004
parent reply "Walter" <newshound digitalmars.com> writes:
"Ant" <duitoolkit yahoo.ca> wrote in message
news:pan.2004.09.21.01.51.57.386906 yahoo.ca...
 I don't have any invariant on my classes
 however all the methods make a call to

 _D9invariant12_d_invariantFC6ObjectZv

 and a loop is executed there

 what's that for?

Because invariants are inherited, a default invariant is created if there isn't a user supplied one, and that default will call the base class' invariant. Compiling with -release will turn that off.
Sep 21 2004
parent Ant <duitoolkit yahoo.ca> writes:
On Tue, 21 Sep 2004 16:05:47 -0700, Walter wrote:

 
 "Ant" <duitoolkit yahoo.ca> wrote in message
 news:pan.2004.09.21.01.51.57.386906 yahoo.ca...
 I don't have any invariant on my classes
 however all the methods make a call to

 _D9invariant12_d_invariantFC6ObjectZv

 and a loop is executed there

 what's that for?

Because invariants are inherited, a default invariant is created if there isn't a user supplied one, and that default will call the base class' invariant. Compiling with -release will turn that off.

thanks, the release flag! I'm embarassed, it's on the docs... Ant
Sep 21 2004