diff options
Diffstat (limited to 'libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp')
-rw-r--r-- | libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp index a20d6ab7df8..7f75e011bc0 100644 --- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp +++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp @@ -10,14 +10,27 @@ // <algorithm> // template<InputIterator InIter, OutputIterator<auto, InIter::reference> OutIter> -// OutIter +// constexpr OutIter // constexpr after C++17 // copy(InIter first, InIter last, OutIter result); #include <algorithm> #include <cassert> +#include "test_macros.h" #include "test_iterators.h" +// #if TEST_STD_VER > 17 +// TEST_CONSTEXPR bool test_constexpr() { +// int ia[] = {1, 2, 3, 4, 5}; +// int ic[] = {6, 6, 6, 6, 6, 6, 6}; +// +// auto p = std::copy(std::begin(ia), std::end(ia), std::begin(ic)); +// return std::equal(std::begin(ia), std::end(ia), std::begin(ic), p) +// && std::all_of(p, std::end(ic), [](int a){return a == 6;}) +// ; +// } +// #endif + template <class InIter, class OutIter> void test() @@ -70,4 +83,8 @@ int main() test<const int*, bidirectional_iterator<int*> >(); test<const int*, random_access_iterator<int*> >(); test<const int*, int*>(); + +// #if TEST_STD_VER > 17 +// static_assert(test_constexpr()); +// #endif } |