diff options
author | stickies-v <stickies-v@protonmail.com> | 2023-10-19 12:46:32 +0100 |
---|---|---|
committer | stickies-v <stickies-v@protonmail.com> | 2024-08-06 00:23:38 +0100 |
commit | 2925bd537cbd8c70594e23f6c4298b7101f7f73d (patch) | |
tree | 55c109ee30047fb02aecd17b869b72dc1360e6bb /src/test/fuzz | |
parent | 949b67347255c0f2494055cbcdbb729a6476ded7 (diff) | |
download | bitcoin-2925bd537cbd8c70594e23f6c4298b7101f7f73d.tar.xz |
refactor: use c++20 std::views::reverse instead of reverse_iterator.h
Use std::ranges::views::reverse instead of the implementation in
reverse_iterator.h, and remove it as it is no longer used.
Diffstat (limited to 'src/test/fuzz')
-rw-r--r-- | src/test/fuzz/prevector.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/test/fuzz/prevector.cpp b/src/test/fuzz/prevector.cpp index 9cea32e304..aeceb38a58 100644 --- a/src/test/fuzz/prevector.cpp +++ b/src/test/fuzz/prevector.cpp @@ -2,16 +2,14 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include <test/fuzz/FuzzedDataProvider.h> -#include <test/fuzz/fuzz.h> - #include <prevector.h> -#include <vector> - -#include <reverse_iterator.h> #include <serialize.h> #include <streams.h> +#include <test/fuzz/FuzzedDataProvider.h> +#include <test/fuzz/fuzz.h> +#include <ranges> +#include <vector> namespace { template <unsigned int N, typename T> @@ -47,7 +45,7 @@ public: assert(v == real_vector[pos]); ++pos; } - for (const T& v : reverse_iterate(pre_vector)) { + for (const T& v : pre_vector | std::views::reverse) { --pos; assert(v == real_vector[pos]); } @@ -55,7 +53,7 @@ public: assert(v == real_vector[pos]); ++pos; } - for (const T& v : reverse_iterate(const_pre_vector)) { + for (const T& v : const_pre_vector | std::views::reverse) { --pos; assert(v == real_vector[pos]); } |