Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2005-06-13 16:53:12


"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:005901c57053$c77160e0$6401a8c0_at_pdimov2...
> Beman Dawes wrote:
>
>> The "too similar" problem with overloading predicate functions on
>> directory_iterator is that two very similar calls have different
>> behavior:
>> if ( is_directory( *itr ) ) // uses current status
>>
>> if ( is_directory( itr ) ) // uses cached status, which may be very
>> stale
>>
>> That looks like a race-condition trap for unwary users.
>
> I could argue that the second form is less "trappy" for unwary users,
> actually, because all is_directory( itr ) calls will always yield the same
> value (and exists(itr) will never yield false for an enumerated item).

Yes. I'm probably worrying too much.

--Beman


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