aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2021-02-10 12:27:49 +0100
committerFelix Morgner <felix.morgner@gmail.com>2021-02-10 12:27:49 +0100
commit4fc2b7acffb9699c3ef4fbe5027124e589735be0 (patch)
treef9582797e1f0fe8fc1a80c657d55a7af0fce0a52
parent13b66c3074cbc6e502e97a76993f513a58e21f08 (diff)
downloadwanda-4fc2b7acffb9699c3ef4fbe5027124e589735be0.tar.xz
wanda-4fc2b7acffb9699c3ef4fbe5027124e589735be0.zip
wanda: port to standard ranges
-rw-r--r--CMakeLists.txt3
-rw-r--r--conanfile.py5
-rw-r--r--src/wanda/filesystem.cpp14
3 files changed, 11 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3db7399..4fe0f53 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,7 @@ project("wanda" LANGUAGES CXX)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
-set(CMAKE_CXX_STANDARD "17")
+set(CMAKE_CXX_STANDARD "20")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
@@ -91,7 +91,6 @@ add_library("${PROJECT_NAME}" STATIC
target_link_libraries("${PROJECT_NAME}"
"${C++FS_LIBRARIES}"
"CONAN_PKG::asio"
- "CONAN_PKG::range-v3"
"CONAN_PKG::spdlog"
"Threads::Threads"
)
diff --git a/conanfile.py b/conanfile.py
index dbe4c65..1635cb6 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -25,11 +25,10 @@ class Wanda(ConanFile):
"src/*",
)
requires = (
- "asio/1.12.2",
- "lyra/1.2.0",
+ "asio/1.18.1",
+ "lyra/1.5.1",
"CUTE/2.2.6@fmorgner/stable",
"spdlog/1.4.2",
- "range-v3/0.4.0@ericniebler/stable",
)
def configure_cmake(self):
diff --git a/src/wanda/filesystem.cpp b/src/wanda/filesystem.cpp
index d94894a..4da30b1 100644
--- a/src/wanda/filesystem.cpp
+++ b/src/wanda/filesystem.cpp
@@ -1,8 +1,7 @@
#include <wanda/filesystem.hpp>
-#include <range/v3/all.hpp>
-
#include <random>
+#include <ranges>
namespace wanda
{
@@ -12,10 +11,13 @@ namespace wanda
{
return std::nullopt;
}
-
- 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);
+ auto entries = std::filesystem::recursive_directory_iterator{source};
+ auto result = path_list{};
+ for (auto & entry : entries | std::views::filter(filter))
+ {
+ result.push_back(entry.path());
+ }
+ return result;
}
std::filesystem::path random_pick(path_list const & paths)