summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2018-01-22 18:38:18 +0000
committerMarshall Clow <mclow.lists@gmail.com>2018-01-22 18:38:18 +0000
commitcbe768ec694d4b374cbb84eb32a2ffcde82a0f7b (patch)
treeec742db685b85b97e2f347dde8f4da1071733a20 /libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp
parent1d89cd2bb4f1cc0288b6d9fb5821260f81b9509f (diff)
downloadbcm5719-llvm-cbe768ec694d4b374cbb84eb32a2ffcde82a0f7b.tar.gz
bcm5719-llvm-cbe768ec694d4b374cbb84eb32a2ffcde82a0f7b.zip
Add (commented out) constexpr tests for copy/copy_backwards/copy_if/copy_n. These will be enabled when that part of P0202 is implemented. NFC at this time.
llvm-svn: 323137
Diffstat (limited to 'libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp')
-rw-r--r--libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp
index 1dba8847c7e..24e5577b04e 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy_n.pass.cpp
@@ -10,15 +10,28 @@
// <algorithm>
// template<InputIterator InIter, OutputIterator<auto, InIter::reference> OutIter>
-// OutIter
+// constexpr OutIter // constexpr after C++17
// copy_n(InIter first, InIter::difference_type n, OutIter result);
#include <algorithm>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "user_defined_integral.hpp"
+// #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_n(std::begin(ia), 4, std::begin(ic));
+// return std::equal(std::begin(ic), p, std::begin(ia))
+// && std::all_of(p, std::end(ic), [](int a){return a == 6;})
+// ;
+// }
+// #endif
+
typedef UserDefinedIntegral<unsigned> UDI;
template <class InIter, class OutIter>
@@ -73,4 +86,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
}
OpenPOWER on IntegriCloud