Boost logo

Boost :

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

"Peter Dimov" <pdimov_at_[hidden]> wrote in message
> 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.


Boost list run by bdawes at, gregod at, cpdaniel at, john at