From 342412a11405931d46667b179b9e861b8ed39875 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Tue, 18 Dec 2018 11:20:18 +0100 Subject: wanda: replace boost::iterator with range v3 --- CMakeLists.txt | 1 + conanfile.py | 3 ++- src/wanda/filesystem.cpp | 9 +++++---- 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 -#include +// #include +#include #include @@ -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) -- cgit v1.2.3