[Boost-bugs] [Boost C++ Libraries] #5403: filesystem3::recursive_directory_iterator::increment(system::error_code& ec) unexpected behaviour

Subject: [Boost-bugs] [Boost C++ Libraries] #5403: filesystem3::recursive_directory_iterator::increment(system::error_code& ec) unexpected behaviour
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-03-31 07:20:16


#5403: filesystem3::recursive_directory_iterator::increment(system::error_code&
ec) unexpected behaviour
----------------------------------------------------+-----------------------
 Reporter: ttan@… | Owner: bemandawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost Development Trunk | Severity: Showstopper
 Keywords: recursive_directory_iterator increment |
----------------------------------------------------+-----------------------
 please see this link [http://boost.2283326.n4.nabble.com/How-to-skip-a
 -sub-directory-with-filesystem3-recursive-directory-iterator-in-case-of-
 exception-td3417953.html] for details.

 ideally, something like below should be working for either
 throwing(ec.m_val !=0) or no-throwing(ec.m_val ==0 ) case.


 {{{
 boost::system::error_code ec;
 for (recursive_directory_iterator itr(root, ec), itr_end; itr!=itr_end;
 )
 {
         ... ;
             itr.increment(ec);
             if(ec) itr.pop();
 }
 }}}


 Additionally, the intuitive expectation is that:
 recursive_directory_iterator::increment(ec) is a drop-in replacement and
 behaves like recursive_directory_iterator::increment() or
 recursive_directory_iterator::operator++() in case of no throw(ec.m_val ==
 0). To be more specifically, in such a case, the above code is expected to
 be effectively the same as:

 for (recursive_directory_iterator itr(root), itr_end; itr!=itr_end;
 )
 {
         ... ;
             itr.increment(); // or itr++;
 }

 and

 for (recursive_directory_iterator itr(root), itr_end; itr!=itr_end; itr++)
 {
         ... ;
 }

 the current implementation does not allow it.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5403>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC