aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--conanfile.py3
-rw-r--r--src/wanda/filesystem.cpp9
3 files changed, 8 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 79b8421..42d2c2b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,6 +58,7 @@ add_wanda_library(NAME "wanda"
LIBRARIES
"CONAN_PKG::asio"
"CONAN_PKG::spdlog"
+ "CONAN_PKG::range-v3"
"SYSTEM::C++FS"
"Threads::Threads"
)
diff --git a/conanfile.py b/conanfile.py
index 701cab6..b52a100 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -11,6 +11,7 @@ class Wanda(ConanFile):
generators = "cmake"
default_user = "fmorgner"
default_channel = "stable"
+ build_policy = "missing"
settings = (
"os",
"arch",
@@ -24,9 +25,9 @@ class Wanda(ConanFile):
)
requires = (
"asio/1.12.0@bincrafters/stable",
- "boost_iterator/1.67.0@bincrafters/stable",
"clara/1.1.5@bincrafters/stable",
"spdlog/1.2.1@bincrafters/stable",
+ "range-v3/0.4.0@ericniebler/stable",
)
default_options = {
"asio:standalone": True,
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)