1 2 // Copyright 2018 Peter Dimov. 3 // 4 // Distributed under the Boost Software License, Version 1.0. 5 // 6 // See accompanying file LICENSE_1_0.txt or copy at 7 // http://www.boost.org/LICENSE_1_0.txt 8 9 // See library home page at http://www.boost.org/libs/filesystem 10 11 #include <boost/filesystem.hpp> 12 #include <boost/foreach.hpp> 13 #include <boost/config.hpp> 14 15 namespace fs = boost::filesystem; 16 main()17int main() 18 { 19 { 20 fs::directory_iterator const it; 21 22 BOOST_FOREACH( fs::path const& p, it ) 23 { 24 p.string(); 25 } 26 } 27 28 #if !defined(BOOST_NO_CXX11_RANGE_BASED_FOR) 29 30 { 31 fs::directory_iterator const it; 32 33 for( fs::path const& p: it ) 34 { 35 p.string(); 36 } 37 } 38 39 #endif 40 41 { 42 fs::recursive_directory_iterator it; 43 44 BOOST_FOREACH( fs::path const& p, it ) 45 { 46 p.string(); 47 } 48 } 49 50 #if !defined(BOOST_NO_CXX11_RANGE_BASED_FOR) 51 52 { 53 fs::recursive_directory_iterator const it; 54 55 for( fs::path const& p: it ) 56 { 57 p.string(); 58 } 59 } 60 61 #endif 62 } 63