Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-08-25 15:10:34


Howard Hinnant:

> I'm strictly looking at this from the client's point of view. I'm the
> client. I know what I want, and I want to be able to pick something
> and know what it does. I don't want to be stuck with something that
> maybe does something, and maybe not. It's like buying something with
> absolutely no warranty.

No, I don't agree. This is like saying that if the car you bought promises
40 MPG and delivers 45, you'd return it because it doesn't meet the spec.

Bad analogies aside, giving the implementation the opportunity to check the
assumptions of your code is not as worthless as you make it to be. It does
not just "add a bunch of undefined behavior", it adds a license for the
implementation to turn the already erratic behavior into a predictable
assertion failure.

If the client has used the mutex constructor, this means that his code has
already made the assumption that the condition will be used with that mutex.
If you take away the Requires clause (the "bunch of undefined behavior"),
this will not make the code any more correct and can never be an
improvement; it would be, at worst, a tie if the implementation did no
checking.


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