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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323137 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2018-01-22 18:38:18 +00:00
parent 27ae75c894
commit c84b496981
4 changed files with 74 additions and 4 deletions

View File

@@ -11,13 +11,28 @@
// template<BidirectionalIterator InIter, BidirectionalIterator OutIter>
// requires OutputIterator<OutIter, InIter::reference>
// OutIter
// constexpr OutIter // constexpr after C++17
// copy_backward(InIter first, InIter last, 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};
//
// size_t N = std::size(ia);
// auto p = std::copy_backward(std::begin(ia), std::end(ia), std::begin(ic) + N);
// return std::equal(std::begin(ic), p, std::begin(ia))
// && std::all_of(p, std::end(ic), [](int a){return a == 6;})
// ;
// }
// #endif
template <class InIter, class OutIter>
void
@@ -48,4 +63,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
}