Boost logo

Boost :

From: E. Gladyshev (egladysh_at_[hidden])
Date: 2003-10-29 21:26:40


--- Fernando Cacciola <fernando_cacciola_at_[hidden]> wrote:
[...]
> > You can imaging some examples like the following.
> > struct type
> > {
> > //invariant is x + y = 10
> > int x;
> > int y;
> >
> > void f( int n )
> > {
> > x = n; //* invariant is broken
> > f1(); //* is this allowed?
> > y = 10-n; //* invariant restored
> > }
> >
> The way I see it, if f1() is not public, then the above is most likely OK.
> If is it public, then it is most likely not OK.

According to Dave (if understood him right),
it is Ok to call not just a public method of the same type
but any method of any type internally
while the invariant is broken.

For example it seems to be ok to do the following.
   void f( int n )
   {
      x = n; //* invariant is broken
      new some_other_type; //*** calling an outside method
      y = 10-n; //* invariant restored
   }

Eugene

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk