|
Boost : |
From: Beman Dawes (bdawes_at_[hidden])
Date: 2002-09-14 13:43:40
At 08:33 AM 9/14/2002, Thomas Witt wrote:
>On Friday 13 September 2002 19:49, Beman Dawes wrote:
>> * The directory_iterator implementation now uses
>boost::iterator_adaptor<>.
>
>IIUC directory_iterator is derived from iterator_adaptor and reimplements
>operator-> as a compiler workaround.
>
>Are you sure the following works (i.e. does not need the workaround)
>
>(++directory_iterator(valid_directory_path))->file_path(); ?
>
>See posting
>
>http://aspn.activestate.com/ASPN/Mail/Message/boost/1356436
I added a test case to operations_test.cpp, and it failed miserably at run
time (protection fault) for all compilers except Borland:-( Incrementing
the iterator first in a separate expression, then using ->, worked
correctly.
I frankly don't understand the details of this problem. Am I using
iterator_adaptor incorrectly, or is there really a compiler problem, or is
there a problem with iterator_adaptor?
If it is a compiler problem, we need a better workaround obviously. Also
there should be a BOOST_NO_xxx macro so we can #ifdef the workaround code
so it doesn't live forever.
Thanks for the alert!
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk