mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 12:02:36 +08:00
Another batch of P0202 constepr algirithms. remove/remove_if/remove_copy/remove_copy_if/reverse_copy, and tests (commented out) for rotate_copy, because that depends on std::copy
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323152 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -10,14 +10,31 @@
|
||||
// <algorithm>
|
||||
|
||||
// template<ForwardIterator InIter, OutputIterator<auto, InIter::reference> OutIter>
|
||||
// OutIter
|
||||
// constexpr OutIter // constexpr after C++17
|
||||
// rotate_copy(InIter first, InIter middle, 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, 3, 5, 2, 5, 6};
|
||||
// int ib[std::size(ia)] = {0};
|
||||
//
|
||||
// const size_t N = 2;
|
||||
// const auto middle = std::begin(ia) + N;
|
||||
// auto it = std::rotate_copy(std::begin(ia), middle, std::end(ia), std::begin(ib));
|
||||
//
|
||||
// return std::distance(std::begin(ib), it) == std::size(ia)
|
||||
// && std::equal (std::begin(ia), middle, std::begin(ib) + std::size(ia) - N)
|
||||
// && std::equal (middle, std::end(ia), std::begin(ib))
|
||||
// ;
|
||||
// }
|
||||
// #endif
|
||||
|
||||
template <class InIter, class OutIter>
|
||||
void
|
||||
test()
|
||||
@@ -131,4 +148,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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user