Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-03-31 19:17:20


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).

If you make 'exists' throw an exception, you will create a demand for a
'preexists' query that will be used to detect whether the actual 'exists'
will throw.


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