Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-04-21 03:17:38


There's a bug report on sourceforge:

https://sourceforge.net/tracker/index.php?func=detail&aid=937606&group_id=7586&atid=107586

which boils down to the fact that

    directory_iterator it(...);

    path p = *it++;

does not work correctly. The exact problem is that the above line return a
copy of the iterator, and increments 'it', but both iterators have shared_ptr
to the same internal structure, so by time user deferences the copy, it gets
the next file in the directory.

The filesystem lib sources contain the following comment:

    The *r++ requirement doesn't appear to apply to the new
     single_pass_traversal category
     Thus I'm leaving the proxy out pending confirmation from the N1477
     authors

I'm not sure I understand that. It seems that *r++ should work, since signle
pass iterator requires that r++ should work and return object of type X (call
it r2), and the reabable iterator requires that *r2 should work. Am I wrong?

And BTW, don't the above requirements mean r++ cannot return a proxy object,
but only a real copy of the iterator?

- Volodya


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