Skip to content

Commit 76b025a

Browse files
committed
Guard for lack of output_iterator-nesss
1 parent 9ae52f4 commit 76b025a

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

libcxx/test/benchmarks/algorithms/modifying/copy.bench.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "benchmark/benchmark.h"
1919
#include "../../GenerateInput.h"
20+
#include "test_macros.h"
2021

2122
template <class Container, class Operation>
2223
void bm_general(std::string operation_name, Operation copy) {
@@ -74,8 +75,10 @@ int main(int argc, char** argv) {
7475
bm_general<std::vector<int>>("ranges::copy(vector<int>)", ranges_copy);
7576
bm_general<std::deque<int>>("ranges::copy(deque<int>)", ranges_copy);
7677
bm_general<std::list<int>>("ranges::copy(list<int>)", ranges_copy);
78+
#if TEST_STD_VER >= 23 // vector<bool>::iterator is not an output_iterator before C++23
7779
bm_vector_bool<true>("ranges::copy(vector<bool>) (aligned)", ranges_copy);
7880
bm_vector_bool<false>("ranges::copy(vector<bool>) (unaligned)", ranges_copy);
81+
#endif
7982

8083
benchmark::Initialize(&argc, argv);
8184
benchmark::RunSpecifiedBenchmarks();

libcxx/test/benchmarks/algorithms/modifying/copy_backward.bench.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "benchmark/benchmark.h"
1919
#include "../../GenerateInput.h"
20+
#include "test_macros.h"
2021

2122
template <class Container, class Operation>
2223
void bm_general(std::string operation_name, Operation copy_backward) {
@@ -76,8 +77,10 @@ int main(int argc, char** argv) {
7677
bm_general<std::vector<int>>("ranges::copy_backward(vector<int>)", ranges_copy_backward);
7778
bm_general<std::deque<int>>("ranges::copy_backward(deque<int>)", ranges_copy_backward);
7879
bm_general<std::list<int>>("ranges::copy_backward(list<int>)", ranges_copy_backward);
80+
#if TEST_STD_VER >= 23 // vector<bool>::iterator is not an output_iterator before C++23
7981
bm_vector_bool<true>("ranges::copy_backward(vector<bool>) (aligned)", ranges_copy_backward);
8082
bm_vector_bool<false>("ranges::copy_backward(vector<bool>) (unaligned)", ranges_copy_backward);
83+
#endif
8184

8285
benchmark::Initialize(&argc, argv);
8386
benchmark::RunSpecifiedBenchmarks();

libcxx/test/benchmarks/algorithms/modifying/copy_n.bench.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "benchmark/benchmark.h"
1919
#include "../../GenerateInput.h"
20+
#include "test_macros.h"
2021

2122
template <class Container, class Operation>
2223
void bm_general(std::string operation_name, Operation copy_n) {
@@ -73,8 +74,10 @@ int main(int argc, char** argv) {
7374
bm_general<std::vector<int>>("ranges::copy_n(vector<int>)", ranges_copy_n);
7475
bm_general<std::deque<int>>("ranges::copy_n(deque<int>)", ranges_copy_n);
7576
bm_general<std::list<int>>("ranges::copy_n(list<int>)", ranges_copy_n);
77+
#if TEST_STD_VER >= 23 // vector<bool>::iterator is not an output_iterator before C++23
7678
bm_vector_bool<true>("ranges::copy_n(vector<bool>) (aligned)", ranges_copy_n);
7779
bm_vector_bool<false>("ranges::copy_n(vector<bool>) (unaligned)", ranges_copy_n);
80+
#endif
7881

7982
benchmark::Initialize(&argc, argv);
8083
benchmark::RunSpecifiedBenchmarks();

0 commit comments

Comments
 (0)