Boost logo

Boost :

From: Yariv Tal (yariv_tal2003_at_[hidden])
Date: 2005-04-18 02:20:44


Hi Victor,

as you wrote:
[snip]
"Victor A. Wagner Jr." <vawjr_at_[hidden]> wrote in message
news:6.2.0.14.2.20050417092516.08342e98_at_mail.rudbek.com...
>
> I assumed (dangerous, I know) that NO post conditions would be tested on
> exception but those explicitly done in the exception stuff. (maybe they
all
> will be if NO exception conditions are mentioned? like a default
> constructor being built by the compiler).
>
You are right.
If an exception occurs NO post conditions are tested.
If you want a condition to be tested when an exception is thrown, define an
EXCEPTIONAL condition
(I find this useful for testing that the object was not changed = the strong
exception guarentee).

By the way, I use the EXCEPtTIONAL condition as a technique to ensure that
no exception is thrown
(this can be useful if a method's interface allows throwing but you are sure
that your current implementation
does not throw):
EXCEPTIONAL(lambda::constant(false)); // this will always fail if an
exception is thrown

Hope that clarifies things for you.

Yariv.


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