Boost logo

Boost :

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

--- David Abrahams <dave_at_[hidden]> wrote:

> Can you give a "scientific" definition of what you mean by
> "scientific?"

I am not sure... some links/discussions/papers/books
that elaborate on how and when object invariants
can be broken and how to deal with that practically.

I'd be especially interested to see
how basic guarantees are useful in practical C++
Perhaps some practical usage cases.
Are there any special considerations
for breaking invariants and calling other methods
of the broken object internally?

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

  //can f1()/f2() or any internal method
  //assume that invariant is Ok
  void f1() {}
  void f2() {}
This becomes much more complicated if you add
complex polymorphic hierarchies.

It seems that I am not alone who is confused
about this stuff.


Do you Yahoo!?
Exclusive Video Premiere - Britney Spears

Boost list run by bdawes at, gregod at, cpdaniel at, john at