What's happening is that a call to the class invariant is made at the
beginning and end of each public member function. -Walter
"Pavel Minayev" <evilone omen.ru> wrote in message
news:a2bq13$10i8$1 digitaldaemon.com...

What's happening is that a call to the class invariant is made at the
beginning and end of each public member function. -Walter

Yes, I know. But what's the reason in checking invariant for
a function that does nothing? =) I think this should be
optimized away...

Ah, a very good question. And the answer (!) is that if that function is
invoked via a pointer to a derived class object, then the invariant for
that derived class needs to be run.
You could argue that it doesn't need it on both entry and exit since no code
is executed between them. You'd be correct.