|
Boost : |
From: Greg Colvin (gcolvin_at_[hidden])
Date: 2001-03-19 22:59:14
From: Jesse Jones <jejones_at_[hidden]>
> >Yes, but how do you document a function's behavior?
> >"may throw an exception due to low memory or insufficient resources, or if
> >the user passes an invalid object. In the latter case there is no guarantee
> >that the operand is left in a consistent or even destructible state"
>
> You don't. All that you can say is that these sort of violations result in
> undefined behavior. If some client elects to throw an exception it should
> be clear to him that objects may be left in a bad state. I would tend to
> think aborting with an option for saving the user's data in a new file
> would be a better option in release builds, but I'm not sure you can say
> that no one should ever throw exceptions if an assert fails.
Never say never, but I feel no obligation, or even motivation,
to make it easy to do.
> >I believe in simple contracts, guarantees, and invariants. Simple this aint.
>
> Design by Contract. I like it :-). It seems pretty simple to me...
>
> -- Jesse
>
>
>
> List-Unsubscribe: <mailto:boost-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk