Boost logo

Boost :

Subject: [boost] BOOST_FOREACH on a filesystem directory_iterator?
From: Peter Dimov (lists_at_[hidden])
Date: 2018-08-29 10:12:32

Boost.Filesystem apparently contains support for BOOST_FOREACH:

But it doesn't work:

#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>

namespace fs = boost::filesystem;

int main()
    fs::directory_iterator it;

    BOOST_FOREACH( fs::path const& p, it )

1>c:\boost-git\develop\boost/range/end.hpp(48) : error C2039: 'end' : is not
a member of 'boost::filesystem::directory_iterator'

The fix is trivial, but I wonder... how did nobody notice? Is this feature
never used?

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