|
Boost : |
From: Glen Knowles (gknowles_at_[hidden])
Date: 2003-07-21 11:13:34
>David Abrahams wrote:
>>
>> Well, that's not my philosophy FWIW. Mine is:
>>
>> if the condition is a programmer error, use assert
>> otherwise, use a well-documented exception
>
>
>So can I draw you back to the original question of why a locked
>scoped_lock throws rather than asserts? The only thing that can cause
>this is calling lock on it twice which is a programming error, isn't it?
>It certainly isn't dependent on any external factors that I can see.
>Or are assert/throw decisions left up to the individual library
>implementors boost and William Kempf has a different view to yours on
>asserts/throws?
That is a decision that tends to end with the library author. One thing that
may make the specific case of relocking different is that the cause is
likely a race condition - something that won't show up in normal testing.
Glen
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk