Subject: [Boost-bugs] [Boost C++ Libraries] #6521: Directory listing using C++11 range-based for loops
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-02-04 18:15:21
#6521: Directory listing using C++11 range-based for loops
----------------------------------+-----------------------------------------
Reporter: mustrumr97@⦠| Owner: bemandawes
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: filesystem
Version: Boost 1.48.0 | Severity: Cosmetic
Keywords: |
----------------------------------+-----------------------------------------
I have written a simple 'container' class for a directory, 'containing'
all of its subdirectories:
{{{
namespace boost{
namespace filesystem{
class directory{
path p_;
public:
inline directory(path p):p_(p){
return;
}
directory_iterator begin(){
return directory_iterator(p_);
}
directory_iterator end(){
return directory_iterator();
}
};
}
}
}}}
so that that range-based for loop can be used:
{{{
for(auto i:directory("/home")){
...
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6521> 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:08 UTC