diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2018-12-18 11:20:18 +0100 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2018-12-18 11:22:27 +0100 |
| commit | 342412a11405931d46667b179b9e861b8ed39875 (patch) | |
| tree | 4dbe0a0664ae2cac11fe811ef6dafa4297b148b7 /src/wanda/filesystem.cpp | |
| parent | 660472c366c119f09d46d25f1eaeb139e9ec09df (diff) | |
| download | wanda-342412a11405931d46667b179b9e861b8ed39875.tar.xz wanda-342412a11405931d46667b179b9e861b8ed39875.zip | |
wanda: replace boost::iterator with range v3
Diffstat (limited to 'src/wanda/filesystem.cpp')
| -rw-r--r-- | src/wanda/filesystem.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/wanda/filesystem.cpp b/src/wanda/filesystem.cpp index 01dff43..0cf4607 100644 --- a/src/wanda/filesystem.cpp +++ b/src/wanda/filesystem.cpp @@ -1,6 +1,7 @@ #include <wanda/filesystem.hpp> -#include <boost/iterator/filter_iterator.hpp> +// #include <boost/iterator/filter_iterator.hpp> +#include <range/v3/all.hpp> #include <random> @@ -13,9 +14,9 @@ namespace wanda return std::nullopt; } - auto first = boost::make_filter_iterator(filter, std::filesystem::recursive_directory_iterator{source}); - auto last = boost::make_filter_iterator(filter, std::filesystem::recursive_directory_iterator{}); - return path_list{first, last}; + auto begin = std::filesystem::recursive_directory_iterator{source}; + auto end = std::filesystem::recursive_directory_iterator{}; + return ranges::make_iterator_range(begin, end) | ranges::view::filter(filter); } std::filesystem::path random_pick(path_list const & paths) |
