Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2005-03-31 21:20:15


At 08:51 PM 3/31/2005, David Abrahams wrote:
>"Peter Dimov" <pdimov_at_[hidden]> writes:
>
>> Beman Dawes wrote:
>>
>>> At 01:06 PM 3/31/2005, Rob Stewart wrote:
>>
>>>> I disagree. All the caller wants to know is whether the supplied
>>>> pathname refers to an existing file.
>>>
>>> But if it isn't possible to reliably answer that query, shouldn't it
>>> be an error?
>>
>> The answer to this question is probably "no", if by error you mean
>> exception, and here is why.
>>
>> Every exception-throwing function has spawned a predicate that is used
to
>
>> avoid the exception (because exceptions cancel the currently active
>> operation and this is undesirable in some cases).
>
>Separate predicates don't really help you avoid exceptions reliably in
>filesystems because of race conditions. But y'all know that. Why
>have we gone down that road...

One way of looking at the current discussion is that we are trying to avoid
going down that road.

>... as opposed to having an argument that can
>be used to say "don't throw?"

The other semantics of throwing and non-throwing functions may be
different. The importance of avoiding race conditions may be different.
That's why I'm thinking of separate functions distinguished by function
name rather a "don't throw" argument. However, a stat()-like function might
have both throwing and non-throwing versions, with no other differences, so
that might be a candidate for a throw/don't-throw argument.

--Beman


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