Boost logo

Boost :

From: D language (mbosticky_at_[hidden])
Date: 2002-10-28 08:25:44


>Well, exceptions are a part of the method's contract, and I believe they
>should be accounted for in the postconditions.

Only way i can think is to have contract postconditions checked in two
separate places. One in a class destructor that gets called allways, and one
in an explicitly called function.

>However, I see another problem with pre/postconditions: How do you
>implement proper contravariance? That is, on overriden methods, parent's
>implementation should be autochecked, plus, the precondition should be
>and'ed, and postcondition should be or'ed with those of the parent's
>implementation.

Should postcondition be really or'ed? Doesn't a overriden function provide
alternative functionality and even change the desired postcondition? Perhaps
pre and post conditions on virtual functions should not be invoked
automatically. Perhaps only optionally.

>
> Miro
>
>
>_______________________________________________
>Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
>


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