forked from OSchip/llvm-project
[libcxx][nfc] prefixes test type `input_iterator` with `cpp17_`
C++20 revised the definition of what it means to be an iterator. While all _Cpp17InputIterators_ satisfy `std::input_iterator`, the reverse isn't true. D100271 introduces a new test adaptor to accommodate this new definition (`cpp20_input_iterator`). In order to help readers immediately distinguish which input iterator adaptor is _Cpp17InputIterator_, the current `input_iterator` adaptor has been prefixed with `cpp17_`. Differential Revision: https://reviews.llvm.org/D101242
This commit is contained in:
parent
d4d1caafc8
commit
773ae44124
|
@ -62,7 +62,7 @@ void BM_PathConstructIter(benchmark::State &st, GenInputs gen) {
|
|||
}
|
||||
template <class GenInputs>
|
||||
void BM_PathConstructInputIter(benchmark::State &st, GenInputs gen) {
|
||||
BM_PathConstructIter<input_iterator>(st, gen);
|
||||
BM_PathConstructIter<cpp17_input_iterator>(st, gen);
|
||||
}
|
||||
template <class GenInputs>
|
||||
void BM_PathConstructForwardIter(benchmark::State &st, GenInputs gen) {
|
||||
|
|
|
@ -30,8 +30,8 @@ int main(int, char**)
|
|||
int a[] = {1, 2, 3, 4, 5};
|
||||
const int N = sizeof(a)/sizeof(a[0]);
|
||||
std::list<int>::iterator i = v.insert(next(v2.cbegin(), 10),
|
||||
input_iterator<const int*>(a),
|
||||
input_iterator<const int*>(a+N));
|
||||
cpp17_input_iterator<const int*>(a),
|
||||
cpp17_input_iterator<const int*>(a+N));
|
||||
assert(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ int main(int, char**)
|
|||
#endif
|
||||
|
||||
{
|
||||
typedef input_iterator<int*> MyInputIter;
|
||||
typedef cpp17_input_iterator<int*> MyInputIter;
|
||||
// Sould not trigger ASan.
|
||||
std::vector<int> v;
|
||||
v.reserve(1);
|
||||
|
|
|
@ -63,8 +63,8 @@ struct MakeTestType {
|
|||
using const_cstr_type = const CharT*;
|
||||
using array_type = CharT[25];
|
||||
using const_array_type = const CharT[25];
|
||||
using iter_type = input_iterator<CharT*>;
|
||||
using bad_iter_type = input_iterator<signed char*>;
|
||||
using iter_type = cpp17_input_iterator<CharT*>;
|
||||
using bad_iter_type = cpp17_input_iterator<signed char*>;
|
||||
|
||||
template <class TestT>
|
||||
static void AssertPathable() {
|
||||
|
|
|
@ -192,7 +192,7 @@ int main(int, char**)
|
|||
|
||||
// iterators in the libc++ test suite
|
||||
static_assert((!std::__is_cpp17_contiguous_iterator<output_iterator <char *> >::value), "");
|
||||
static_assert((!std::__is_cpp17_contiguous_iterator<input_iterator <char *> >::value), "");
|
||||
static_assert((!std::__is_cpp17_contiguous_iterator<cpp17_input_iterator <char *> >::value), "");
|
||||
static_assert((!std::__is_cpp17_contiguous_iterator<forward_iterator <char *> >::value), "");
|
||||
static_assert((!std::__is_cpp17_contiguous_iterator<bidirectional_iterator<char *> >::value), "");
|
||||
static_assert((!std::__is_cpp17_contiguous_iterator<random_access_iterator<char *> >::value), "");
|
||||
|
|
|
@ -39,11 +39,11 @@ test_copy()
|
|||
TEST_CONSTEXPR_CXX20 bool
|
||||
test()
|
||||
{
|
||||
test_copy<input_iterator<const int*>, output_iterator<int*> >();
|
||||
test_copy<input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test_copy<input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test_copy<input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test_copy<input_iterator<const int*>, int*>();
|
||||
test_copy<cpp17_input_iterator<const int*>, output_iterator<int*> >();
|
||||
test_copy<cpp17_input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test_copy<cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test_copy<cpp17_input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test_copy<cpp17_input_iterator<const int*>, int*>();
|
||||
|
||||
test_copy<forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test_copy<forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
|
@ -70,7 +70,7 @@ test()
|
|||
test_copy<const int*, int*>();
|
||||
|
||||
#if TEST_STD_VER > 17
|
||||
test_copy<input_iterator<const int*>, contiguous_iterator<int*>>();
|
||||
test_copy<cpp17_input_iterator<const int*>, contiguous_iterator<int*>>();
|
||||
test_copy<forward_iterator<const int*>, contiguous_iterator<int*>>();
|
||||
test_copy<bidirectional_iterator<const int*>, contiguous_iterator<int*>>();
|
||||
test_copy<random_access_iterator<const int*>, contiguous_iterator<int*>>();
|
||||
|
|
|
@ -44,36 +44,36 @@ test_copy_if()
|
|||
TEST_CONSTEXPR_CXX20 bool
|
||||
test()
|
||||
{
|
||||
test_copy_if<input_iterator<const int*>, output_iterator<int*> >();
|
||||
test_copy_if<input_iterator<const int*>, input_iterator<int*> >();
|
||||
test_copy_if<input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test_copy_if<input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test_copy_if<input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test_copy_if<input_iterator<const int*>, int*>();
|
||||
test_copy_if<cpp17_input_iterator<const int*>, output_iterator<int*> >();
|
||||
test_copy_if<cpp17_input_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test_copy_if<cpp17_input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test_copy_if<cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test_copy_if<cpp17_input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test_copy_if<cpp17_input_iterator<const int*>, int*>();
|
||||
|
||||
test_copy_if<forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test_copy_if<forward_iterator<const int*>, input_iterator<int*> >();
|
||||
test_copy_if<forward_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test_copy_if<forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
test_copy_if<forward_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test_copy_if<forward_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test_copy_if<forward_iterator<const int*>, int*>();
|
||||
|
||||
test_copy_if<bidirectional_iterator<const int*>, output_iterator<int*> >();
|
||||
test_copy_if<bidirectional_iterator<const int*>, input_iterator<int*> >();
|
||||
test_copy_if<bidirectional_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test_copy_if<bidirectional_iterator<const int*>, forward_iterator<int*> >();
|
||||
test_copy_if<bidirectional_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test_copy_if<bidirectional_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test_copy_if<bidirectional_iterator<const int*>, int*>();
|
||||
|
||||
test_copy_if<random_access_iterator<const int*>, output_iterator<int*> >();
|
||||
test_copy_if<random_access_iterator<const int*>, input_iterator<int*> >();
|
||||
test_copy_if<random_access_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test_copy_if<random_access_iterator<const int*>, forward_iterator<int*> >();
|
||||
test_copy_if<random_access_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test_copy_if<random_access_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test_copy_if<random_access_iterator<const int*>, int*>();
|
||||
|
||||
test_copy_if<const int*, output_iterator<int*> >();
|
||||
test_copy_if<const int*, input_iterator<int*> >();
|
||||
test_copy_if<const int*, cpp17_input_iterator<int*> >();
|
||||
test_copy_if<const int*, forward_iterator<int*> >();
|
||||
test_copy_if<const int*, bidirectional_iterator<int*> >();
|
||||
test_copy_if<const int*, random_access_iterator<int*> >();
|
||||
|
|
|
@ -42,36 +42,36 @@ test_copy_n()
|
|||
TEST_CONSTEXPR_CXX20 bool
|
||||
test()
|
||||
{
|
||||
test_copy_n<input_iterator<const int*>, output_iterator<int*> >();
|
||||
test_copy_n<input_iterator<const int*>, input_iterator<int*> >();
|
||||
test_copy_n<input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test_copy_n<input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test_copy_n<input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test_copy_n<input_iterator<const int*>, int*>();
|
||||
test_copy_n<cpp17_input_iterator<const int*>, output_iterator<int*> >();
|
||||
test_copy_n<cpp17_input_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test_copy_n<cpp17_input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test_copy_n<cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test_copy_n<cpp17_input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test_copy_n<cpp17_input_iterator<const int*>, int*>();
|
||||
|
||||
test_copy_n<forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test_copy_n<forward_iterator<const int*>, input_iterator<int*> >();
|
||||
test_copy_n<forward_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test_copy_n<forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
test_copy_n<forward_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test_copy_n<forward_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test_copy_n<forward_iterator<const int*>, int*>();
|
||||
|
||||
test_copy_n<bidirectional_iterator<const int*>, output_iterator<int*> >();
|
||||
test_copy_n<bidirectional_iterator<const int*>, input_iterator<int*> >();
|
||||
test_copy_n<bidirectional_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test_copy_n<bidirectional_iterator<const int*>, forward_iterator<int*> >();
|
||||
test_copy_n<bidirectional_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test_copy_n<bidirectional_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test_copy_n<bidirectional_iterator<const int*>, int*>();
|
||||
|
||||
test_copy_n<random_access_iterator<const int*>, output_iterator<int*> >();
|
||||
test_copy_n<random_access_iterator<const int*>, input_iterator<int*> >();
|
||||
test_copy_n<random_access_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test_copy_n<random_access_iterator<const int*>, forward_iterator<int*> >();
|
||||
test_copy_n<random_access_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test_copy_n<random_access_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test_copy_n<random_access_iterator<const int*>, int*>();
|
||||
|
||||
test_copy_n<const int*, output_iterator<int*> >();
|
||||
test_copy_n<const int*, input_iterator<int*> >();
|
||||
test_copy_n<const int*, cpp17_input_iterator<int*> >();
|
||||
test_copy_n<const int*, forward_iterator<int*> >();
|
||||
test_copy_n<const int*, bidirectional_iterator<int*> >();
|
||||
test_copy_n<const int*, random_access_iterator<int*> >();
|
||||
|
|
|
@ -63,11 +63,11 @@ test1()
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
test<input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<input_iterator<const int*>, int*>();
|
||||
test<cpp17_input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, int*>();
|
||||
|
||||
test<forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
|
@ -94,11 +94,11 @@ int main(int, char**)
|
|||
test<const int*, int*>();
|
||||
|
||||
#if TEST_STD_VER >= 11
|
||||
test1<input_iterator<std::unique_ptr<int>*>, output_iterator<std::unique_ptr<int>*> >();
|
||||
test1<input_iterator<std::unique_ptr<int>*>, forward_iterator<std::unique_ptr<int>*> >();
|
||||
test1<input_iterator<std::unique_ptr<int>*>, bidirectional_iterator<std::unique_ptr<int>*> >();
|
||||
test1<input_iterator<std::unique_ptr<int>*>, random_access_iterator<std::unique_ptr<int>*> >();
|
||||
test1<input_iterator<std::unique_ptr<int>*>, std::unique_ptr<int>*>();
|
||||
test1<cpp17_input_iterator<std::unique_ptr<int>*>, output_iterator<std::unique_ptr<int>*> >();
|
||||
test1<cpp17_input_iterator<std::unique_ptr<int>*>, forward_iterator<std::unique_ptr<int>*> >();
|
||||
test1<cpp17_input_iterator<std::unique_ptr<int>*>, bidirectional_iterator<std::unique_ptr<int>*> >();
|
||||
test1<cpp17_input_iterator<std::unique_ptr<int>*>, random_access_iterator<std::unique_ptr<int>*> >();
|
||||
test1<cpp17_input_iterator<std::unique_ptr<int>*>, std::unique_ptr<int>*>();
|
||||
|
||||
test1<forward_iterator<std::unique_ptr<int>*>, output_iterator<std::unique_ptr<int>*> >();
|
||||
test1<forward_iterator<std::unique_ptr<int>*>, forward_iterator<std::unique_ptr<int>*> >();
|
||||
|
@ -126,7 +126,7 @@ int main(int, char**)
|
|||
#endif // TEST_STD_VER >= 11
|
||||
|
||||
#if TEST_STD_VER > 17
|
||||
test<input_iterator<const int*>, contiguous_iterator<int*>>();
|
||||
test<cpp17_input_iterator<const int*>, contiguous_iterator<int*>>();
|
||||
test<forward_iterator<const int*>, contiguous_iterator<int*>>();
|
||||
test<bidirectional_iterator<const int*>, contiguous_iterator<int*>>();
|
||||
test<random_access_iterator<const int*>, contiguous_iterator<int*>>();
|
||||
|
@ -138,7 +138,7 @@ int main(int, char**)
|
|||
test<contiguous_iterator<const int*>, int*>();
|
||||
test<contiguous_iterator<const int*>, contiguous_iterator<int*>>();
|
||||
|
||||
test1<input_iterator<std::unique_ptr<int>*>, contiguous_iterator<std::unique_ptr<int>*>>();
|
||||
test1<cpp17_input_iterator<std::unique_ptr<int>*>, contiguous_iterator<std::unique_ptr<int>*>>();
|
||||
test1<forward_iterator<std::unique_ptr<int>*>, contiguous_iterator<std::unique_ptr<int>*>>();
|
||||
test1<bidirectional_iterator<std::unique_ptr<int>*>, contiguous_iterator<std::unique_ptr<int>*>>();
|
||||
test1<random_access_iterator<std::unique_ptr<int>*>, contiguous_iterator<std::unique_ptr<int>*>>();
|
||||
|
@ -150,42 +150,42 @@ int main(int, char**)
|
|||
test1<contiguous_iterator<std::unique_ptr<int>*>, std::unique_ptr<int>*>();
|
||||
test1<contiguous_iterator<std::unique_ptr<int>*>, contiguous_iterator<std::unique_ptr<int>*>>();
|
||||
|
||||
static_assert(test<input_iterator<const int*>, input_iterator<int*> >());
|
||||
static_assert(test<input_iterator<const int*>, forward_iterator<int*> >());
|
||||
static_assert(test<input_iterator<const int*>, bidirectional_iterator<int*> >());
|
||||
static_assert(test<input_iterator<const int*>, random_access_iterator<int*> >());
|
||||
static_assert(test<input_iterator<const int*>, contiguous_iterator<int*> >());
|
||||
static_assert(test<input_iterator<const int*>, int*>());
|
||||
static_assert(test<cpp17_input_iterator<const int*>, cpp17_input_iterator<int*> >());
|
||||
static_assert(test<cpp17_input_iterator<const int*>, forward_iterator<int*> >());
|
||||
static_assert(test<cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >());
|
||||
static_assert(test<cpp17_input_iterator<const int*>, random_access_iterator<int*> >());
|
||||
static_assert(test<cpp17_input_iterator<const int*>, contiguous_iterator<int*> >());
|
||||
static_assert(test<cpp17_input_iterator<const int*>, int*>());
|
||||
|
||||
static_assert(test<forward_iterator<const int*>, input_iterator<int*> >());
|
||||
static_assert(test<forward_iterator<const int*>, cpp17_input_iterator<int*> >());
|
||||
static_assert(test<forward_iterator<const int*>, forward_iterator<int*> >());
|
||||
static_assert(test<forward_iterator<const int*>, bidirectional_iterator<int*> >());
|
||||
static_assert(test<forward_iterator<const int*>, random_access_iterator<int*> >());
|
||||
static_assert(test<forward_iterator<const int*>, contiguous_iterator<int*> >());
|
||||
static_assert(test<forward_iterator<const int*>, int*>());
|
||||
|
||||
static_assert(test<bidirectional_iterator<const int*>, input_iterator<int*> >());
|
||||
static_assert(test<bidirectional_iterator<const int*>, cpp17_input_iterator<int*> >());
|
||||
static_assert(test<bidirectional_iterator<const int*>, forward_iterator<int*> >());
|
||||
static_assert(test<bidirectional_iterator<const int*>, bidirectional_iterator<int*> >());
|
||||
static_assert(test<bidirectional_iterator<const int*>, random_access_iterator<int*> >());
|
||||
static_assert(test<bidirectional_iterator<const int*>, contiguous_iterator<int*> >());
|
||||
static_assert(test<bidirectional_iterator<const int*>, int*>());
|
||||
|
||||
static_assert(test<random_access_iterator<const int*>, input_iterator<int*> >());
|
||||
static_assert(test<random_access_iterator<const int*>, cpp17_input_iterator<int*> >());
|
||||
static_assert(test<random_access_iterator<const int*>, forward_iterator<int*> >());
|
||||
static_assert(test<random_access_iterator<const int*>, bidirectional_iterator<int*> >());
|
||||
static_assert(test<random_access_iterator<const int*>, random_access_iterator<int*> >());
|
||||
static_assert(test<random_access_iterator<const int*>, contiguous_iterator<int*> >());
|
||||
static_assert(test<random_access_iterator<const int*>, int*>());
|
||||
|
||||
static_assert(test<contiguous_iterator<const int*>, input_iterator<int*> >());
|
||||
static_assert(test<contiguous_iterator<const int*>, cpp17_input_iterator<int*> >());
|
||||
static_assert(test<contiguous_iterator<const int*>, forward_iterator<int*> >());
|
||||
static_assert(test<contiguous_iterator<const int*>, bidirectional_iterator<int*> >());
|
||||
static_assert(test<contiguous_iterator<const int*>, random_access_iterator<int*> >());
|
||||
static_assert(test<contiguous_iterator<const int*>, contiguous_iterator<int*> >());
|
||||
static_assert(test<contiguous_iterator<const int*>, int*>());
|
||||
|
||||
static_assert(test<const int*, input_iterator<int*> >());
|
||||
static_assert(test<const int*, cpp17_input_iterator<int*> >());
|
||||
static_assert(test<const int*, forward_iterator<int*> >());
|
||||
static_assert(test<const int*, bidirectional_iterator<int*> >());
|
||||
static_assert(test<const int*, random_access_iterator<int*> >());
|
||||
|
|
|
@ -39,8 +39,8 @@ int main(int, char**) {
|
|||
{
|
||||
const int ia[] = {1, 2, 3, 4, 5, 6};
|
||||
unary_counting_predicate<is_odd, int> pred((is_odd()));
|
||||
assert(!std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
|
||||
input_iterator<const int *>(std::end(ia)),
|
||||
assert(!std::is_partitioned(cpp17_input_iterator<const int *>(std::begin(ia)),
|
||||
cpp17_input_iterator<const int *>(std::end(ia)),
|
||||
std::ref(pred)));
|
||||
assert(static_cast<std::ptrdiff_t>(pred.count()) <=
|
||||
std::distance(std::begin(ia), std::end(ia)));
|
||||
|
@ -48,8 +48,8 @@ int main(int, char**) {
|
|||
{
|
||||
const int ia[] = {1, 3, 5, 2, 4, 6};
|
||||
unary_counting_predicate<is_odd, int> pred((is_odd()));
|
||||
assert(std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
|
||||
input_iterator<const int *>(std::end(ia)),
|
||||
assert(std::is_partitioned(cpp17_input_iterator<const int *>(std::begin(ia)),
|
||||
cpp17_input_iterator<const int *>(std::end(ia)),
|
||||
std::ref(pred)));
|
||||
assert(static_cast<std::ptrdiff_t>(pred.count()) <=
|
||||
std::distance(std::begin(ia), std::end(ia)));
|
||||
|
@ -57,8 +57,8 @@ int main(int, char**) {
|
|||
{
|
||||
const int ia[] = {2, 4, 6, 1, 3, 5};
|
||||
unary_counting_predicate<is_odd, int> pred((is_odd()));
|
||||
assert(!std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
|
||||
input_iterator<const int *>(std::end(ia)),
|
||||
assert(!std::is_partitioned(cpp17_input_iterator<const int *>(std::begin(ia)),
|
||||
cpp17_input_iterator<const int *>(std::end(ia)),
|
||||
std::ref(pred)));
|
||||
assert(static_cast<std::ptrdiff_t>(pred.count()) <=
|
||||
std::distance(std::begin(ia), std::end(ia)));
|
||||
|
@ -66,8 +66,8 @@ int main(int, char**) {
|
|||
{
|
||||
const int ia[] = {1, 3, 5, 2, 4, 6, 7};
|
||||
unary_counting_predicate<is_odd, int> pred((is_odd()));
|
||||
assert(!std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
|
||||
input_iterator<const int *>(std::end(ia)),
|
||||
assert(!std::is_partitioned(cpp17_input_iterator<const int *>(std::begin(ia)),
|
||||
cpp17_input_iterator<const int *>(std::end(ia)),
|
||||
std::ref(pred)));
|
||||
assert(static_cast<std::ptrdiff_t>(pred.count()) <=
|
||||
std::distance(std::begin(ia), std::end(ia)));
|
||||
|
@ -75,8 +75,8 @@ int main(int, char**) {
|
|||
{
|
||||
const int ia[] = {1, 3, 5, 2, 4, 6, 7};
|
||||
unary_counting_predicate<is_odd, int> pred((is_odd()));
|
||||
assert(std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
|
||||
input_iterator<const int *>(std::begin(ia)),
|
||||
assert(std::is_partitioned(cpp17_input_iterator<const int *>(std::begin(ia)),
|
||||
cpp17_input_iterator<const int *>(std::begin(ia)),
|
||||
std::ref(pred)));
|
||||
assert(static_cast<std::ptrdiff_t>(pred.count()) <=
|
||||
std::distance(std::begin(ia), std::begin(ia)));
|
||||
|
@ -84,8 +84,8 @@ int main(int, char**) {
|
|||
{
|
||||
const int ia[] = {1, 3, 5, 7, 9, 11, 2};
|
||||
unary_counting_predicate<is_odd, int> pred((is_odd()));
|
||||
assert(std::is_partitioned(input_iterator<const int *>(std::begin(ia)),
|
||||
input_iterator<const int *>(std::end(ia)),
|
||||
assert(std::is_partitioned(cpp17_input_iterator<const int *>(std::begin(ia)),
|
||||
cpp17_input_iterator<const int *>(std::end(ia)),
|
||||
std::ref(pred)));
|
||||
assert(static_cast<std::ptrdiff_t>(pred.count()) <=
|
||||
std::distance(std::begin(ia), std::end(ia)));
|
||||
|
|
|
@ -50,8 +50,8 @@ int main(int, char**)
|
|||
int r1[10] = {0};
|
||||
int r2[10] = {0};
|
||||
typedef std::pair<output_iterator<int*>, int*> P;
|
||||
P p = std::partition_copy(input_iterator<const int*>(std::begin(ia)),
|
||||
input_iterator<const int*>(std::end(ia)),
|
||||
P p = std::partition_copy(cpp17_input_iterator<const int*>(std::begin(ia)),
|
||||
cpp17_input_iterator<const int*>(std::end(ia)),
|
||||
output_iterator<int*>(r1), r2, is_odd());
|
||||
assert(p.first.base() == r1 + 4);
|
||||
assert(r1[0] == 1);
|
||||
|
|
|
@ -39,7 +39,7 @@ int main(int, char**) {
|
|||
// expected-error-re@algorithm:* {{static_assert failed{{( due to requirement '.*')?}} "SampleIterator must meet the requirements of RandomAccessIterator"}}
|
||||
// expected-error@algorithm:* 2 {{does not provide a subscript operator}}
|
||||
// expected-error@algorithm:* {{invalid operands}}
|
||||
test<input_iterator<int *>, output_iterator<int *> >();
|
||||
test<cpp17_input_iterator<int *>, output_iterator<int *> >();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -137,23 +137,23 @@ void test_small_population() {
|
|||
}
|
||||
|
||||
int main(int, char**) {
|
||||
test<input_iterator, int, random_access_iterator, int>();
|
||||
test<cpp17_input_iterator, int, random_access_iterator, int>();
|
||||
test<forward_iterator, int, output_iterator, int>();
|
||||
test<forward_iterator, int, random_access_iterator, int>();
|
||||
|
||||
test<input_iterator, int, random_access_iterator, double>();
|
||||
test<cpp17_input_iterator, int, random_access_iterator, double>();
|
||||
test<forward_iterator, int, output_iterator, double>();
|
||||
test<forward_iterator, int, random_access_iterator, double>();
|
||||
|
||||
test_empty_population<input_iterator, int, random_access_iterator, int>();
|
||||
test_empty_population<cpp17_input_iterator, int, random_access_iterator, int>();
|
||||
test_empty_population<forward_iterator, int, output_iterator, int>();
|
||||
test_empty_population<forward_iterator, int, random_access_iterator, int>();
|
||||
|
||||
test_empty_sample<input_iterator, int, random_access_iterator, int>();
|
||||
test_empty_sample<cpp17_input_iterator, int, random_access_iterator, int>();
|
||||
test_empty_sample<forward_iterator, int, output_iterator, int>();
|
||||
test_empty_sample<forward_iterator, int, random_access_iterator, int>();
|
||||
|
||||
test_small_population<input_iterator, int, random_access_iterator, int>();
|
||||
test_small_population<cpp17_input_iterator, int, random_access_iterator, int>();
|
||||
test_small_population<forward_iterator, int, output_iterator, int>();
|
||||
test_small_population<forward_iterator, int, random_access_iterator, int>();
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ void test_stability(bool expect_stable) {
|
|||
|
||||
int main(int, char**) {
|
||||
test_stability<forward_iterator<int *>, output_iterator<int *> >(true);
|
||||
test_stability<input_iterator<int *>, random_access_iterator<int *> >(false);
|
||||
test_stability<cpp17_input_iterator<int *>, random_access_iterator<int *> >(false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -52,11 +52,11 @@ test()
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
test<input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<input_iterator<const int*>, int*>();
|
||||
test<cpp17_input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, int*>();
|
||||
|
||||
test<forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
|
|
|
@ -57,11 +57,11 @@ test()
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
test<input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<input_iterator<const int*>, int*>();
|
||||
test<cpp17_input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, int*>();
|
||||
|
||||
test<forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
|
|
|
@ -56,11 +56,11 @@ test()
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
test<input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<input_iterator<const int*>, int*>();
|
||||
test<cpp17_input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, int*>();
|
||||
|
||||
test<forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
|
|
|
@ -60,11 +60,11 @@ test()
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
test<input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<input_iterator<const int*>, int*>();
|
||||
test<cpp17_input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, int*>();
|
||||
|
||||
test<forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
|
|
|
@ -58,176 +58,176 @@ test()
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
test<input_iterator<const int*>, input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<input_iterator<const int*>, input_iterator<const int*>, input_iterator<int*> >();
|
||||
test<input_iterator<const int*>, input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<input_iterator<const int*>, input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<input_iterator<const int*>, input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<input_iterator<const int*>, input_iterator<const int*>, int*>();
|
||||
test<cpp17_input_iterator<const int*>, cpp17_input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, cpp17_input_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, cpp17_input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, cpp17_input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, cpp17_input_iterator<const int*>, int*>();
|
||||
|
||||
test<input_iterator<const int*>, forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<const int*>, input_iterator<int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<const int*>, int*>();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<const int*>, int*>();
|
||||
|
||||
test<input_iterator<const int*>, bidirectional_iterator<const int*>, output_iterator<int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<const int*>, input_iterator<int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<const int*>, int*>();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<const int*>, output_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<const int*>, int*>();
|
||||
|
||||
test<input_iterator<const int*>, random_access_iterator<const int*>, output_iterator<int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<const int*>, input_iterator<int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<const int*>, int*>();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<const int*>, output_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<const int*>, int*>();
|
||||
|
||||
test<input_iterator<const int*>, const int*, output_iterator<int*> >();
|
||||
test<input_iterator<const int*>, const int*, input_iterator<int*> >();
|
||||
test<input_iterator<const int*>, const int*, forward_iterator<int*> >();
|
||||
test<input_iterator<const int*>, const int*, bidirectional_iterator<int*> >();
|
||||
test<input_iterator<const int*>, const int*, random_access_iterator<int*> >();
|
||||
test<input_iterator<const int*>, const int*, int*>();
|
||||
test<cpp17_input_iterator<const int*>, const int*, output_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, const int*, cpp17_input_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, const int*, forward_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, const int*, bidirectional_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, const int*, random_access_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, const int*, int*>();
|
||||
|
||||
test<forward_iterator<const int*>, input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, input_iterator<const int*>, input_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, input_iterator<const int*>, int*>();
|
||||
test<forward_iterator<const int*>, cpp17_input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, cpp17_input_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, cpp17_input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, cpp17_input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, cpp17_input_iterator<const int*>, int*>();
|
||||
|
||||
test<forward_iterator<const int*>, forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<const int*>, input_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<const int*>, int*>();
|
||||
|
||||
test<forward_iterator<const int*>, bidirectional_iterator<const int*>, output_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, bidirectional_iterator<const int*>, input_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, bidirectional_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, bidirectional_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, bidirectional_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, bidirectional_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, bidirectional_iterator<const int*>, int*>();
|
||||
|
||||
test<forward_iterator<const int*>, random_access_iterator<const int*>, output_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, random_access_iterator<const int*>, input_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, random_access_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, random_access_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, random_access_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, random_access_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, random_access_iterator<const int*>, int*>();
|
||||
|
||||
test<forward_iterator<const int*>, const int*, output_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, const int*, input_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, const int*, cpp17_input_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, const int*, forward_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, const int*, bidirectional_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, const int*, random_access_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, const int*, int*>();
|
||||
|
||||
test<bidirectional_iterator<const int*>, input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, input_iterator<const int*>, input_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, input_iterator<const int*>, int*>();
|
||||
test<bidirectional_iterator<const int*>, cpp17_input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, cpp17_input_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, cpp17_input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, cpp17_input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, cpp17_input_iterator<const int*>, int*>();
|
||||
|
||||
test<bidirectional_iterator<const int*>, forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, forward_iterator<const int*>, input_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, forward_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, forward_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, forward_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, forward_iterator<const int*>, int*>();
|
||||
|
||||
test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*>, output_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*>, input_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*>, int*>();
|
||||
|
||||
test<bidirectional_iterator<const int*>, random_access_iterator<const int*>, output_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, random_access_iterator<const int*>, input_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, random_access_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, random_access_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, random_access_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, random_access_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, random_access_iterator<const int*>, int*>();
|
||||
|
||||
test<bidirectional_iterator<const int*>, const int*, output_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, const int*, input_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, const int*, cpp17_input_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, const int*, forward_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, const int*, bidirectional_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, const int*, random_access_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, const int*, int*>();
|
||||
|
||||
test<random_access_iterator<const int*>, input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, input_iterator<const int*>, input_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, input_iterator<const int*>, int*>();
|
||||
test<random_access_iterator<const int*>, cpp17_input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, cpp17_input_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, cpp17_input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, cpp17_input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, cpp17_input_iterator<const int*>, int*>();
|
||||
|
||||
test<random_access_iterator<const int*>, forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, forward_iterator<const int*>, input_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, forward_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, forward_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, forward_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, forward_iterator<const int*>, int*>();
|
||||
|
||||
test<random_access_iterator<const int*>, bidirectional_iterator<const int*>, output_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, bidirectional_iterator<const int*>, input_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, bidirectional_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, bidirectional_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, bidirectional_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, bidirectional_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, bidirectional_iterator<const int*>, int*>();
|
||||
|
||||
test<random_access_iterator<const int*>, random_access_iterator<const int*>, output_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, random_access_iterator<const int*>, input_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, random_access_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, random_access_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, random_access_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, random_access_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, random_access_iterator<const int*>, int*>();
|
||||
|
||||
test<random_access_iterator<const int*>, const int*, output_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, const int*, input_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, const int*, cpp17_input_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, const int*, forward_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, const int*, bidirectional_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, const int*, random_access_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, const int*, int*>();
|
||||
|
||||
test<const int*, input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<const int*, input_iterator<const int*>, input_iterator<int*> >();
|
||||
test<const int*, input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<const int*, input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<const int*, input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<const int*, input_iterator<const int*>, int*>();
|
||||
test<const int*, cpp17_input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<const int*, cpp17_input_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<const int*, cpp17_input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<const int*, cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<const int*, cpp17_input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<const int*, cpp17_input_iterator<const int*>, int*>();
|
||||
|
||||
test<const int*, forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test<const int*, forward_iterator<const int*>, input_iterator<int*> >();
|
||||
test<const int*, forward_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<const int*, forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<const int*, forward_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<const int*, forward_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<const int*, forward_iterator<const int*>, int*>();
|
||||
|
||||
test<const int*, bidirectional_iterator<const int*>, output_iterator<int*> >();
|
||||
test<const int*, bidirectional_iterator<const int*>, input_iterator<int*> >();
|
||||
test<const int*, bidirectional_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<const int*, bidirectional_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<const int*, bidirectional_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<const int*, bidirectional_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<const int*, bidirectional_iterator<const int*>, int*>();
|
||||
|
||||
test<const int*, random_access_iterator<const int*>, output_iterator<int*> >();
|
||||
test<const int*, random_access_iterator<const int*>, input_iterator<int*> >();
|
||||
test<const int*, random_access_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<const int*, random_access_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<const int*, random_access_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<const int*, random_access_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<const int*, random_access_iterator<const int*>, int*>();
|
||||
|
||||
test<const int*, const int*, output_iterator<int*> >();
|
||||
test<const int*, const int*, input_iterator<int*> >();
|
||||
test<const int*, const int*, cpp17_input_iterator<int*> >();
|
||||
test<const int*, const int*, forward_iterator<int*> >();
|
||||
test<const int*, const int*, bidirectional_iterator<int*> >();
|
||||
test<const int*, const int*, random_access_iterator<int*> >();
|
||||
|
|
|
@ -59,36 +59,36 @@ test()
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
test<input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<input_iterator<const int*>, input_iterator<int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<input_iterator<const int*>, int*>();
|
||||
test<cpp17_input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, int*>();
|
||||
|
||||
test<forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, input_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, int*>();
|
||||
|
||||
test<bidirectional_iterator<const int*>, output_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, input_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<bidirectional_iterator<const int*>, int*>();
|
||||
|
||||
test<random_access_iterator<const int*>, output_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, input_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, cpp17_input_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<random_access_iterator<const int*>, int*>();
|
||||
|
||||
test<const int*, output_iterator<int*> >();
|
||||
test<const int*, input_iterator<int*> >();
|
||||
test<const int*, cpp17_input_iterator<int*> >();
|
||||
test<const int*, forward_iterator<int*> >();
|
||||
test<const int*, bidirectional_iterator<int*> >();
|
||||
test<const int*, random_access_iterator<int*> >();
|
||||
|
|
|
@ -107,11 +107,11 @@ test()
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
test<input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<input_iterator<const int*>, int*>();
|
||||
test<cpp17_input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, int*>();
|
||||
|
||||
test<forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
|
|
|
@ -135,11 +135,11 @@ test()
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
test<input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<input_iterator<const int*>, int*>();
|
||||
test<cpp17_input_iterator<const int*>, output_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<int*> >();
|
||||
test<cpp17_input_iterator<const int*>, int*>();
|
||||
|
||||
test<forward_iterator<const int*>, output_iterator<int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<int*> >();
|
||||
|
|
|
@ -41,18 +41,18 @@ int main(int, char**)
|
|||
{
|
||||
int ia[] = {2, 4, 6, 8};
|
||||
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
|
||||
assert(std::all_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa), test1()) == true);
|
||||
assert(std::all_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia), test1()) == true);
|
||||
assert(std::all_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa), test1()) == true);
|
||||
assert(std::all_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia), test1()) == true);
|
||||
}
|
||||
{
|
||||
const int ia[] = {2, 4, 5, 8};
|
||||
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
|
||||
assert(std::all_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa), test1()) == false);
|
||||
assert(std::all_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia), test1()) == true);
|
||||
assert(std::all_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa), test1()) == false);
|
||||
assert(std::all_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia), test1()) == true);
|
||||
}
|
||||
|
||||
#if TEST_STD_VER > 17
|
||||
|
|
|
@ -41,26 +41,26 @@ int main(int, char**)
|
|||
{
|
||||
int ia[] = {2, 4, 6, 8};
|
||||
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
|
||||
assert(std::any_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa), test1()) == true);
|
||||
assert(std::any_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia), test1()) == false);
|
||||
assert(std::any_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa), test1()) == true);
|
||||
assert(std::any_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia), test1()) == false);
|
||||
}
|
||||
{
|
||||
const int ia[] = {2, 4, 5, 8};
|
||||
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
|
||||
assert(std::any_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa), test1()) == true);
|
||||
assert(std::any_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia), test1()) == false);
|
||||
assert(std::any_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa), test1()) == true);
|
||||
assert(std::any_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia), test1()) == false);
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 3, 5, 7};
|
||||
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
|
||||
assert(std::any_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa), test1()) == false);
|
||||
assert(std::any_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia), test1()) == false);
|
||||
assert(std::any_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa), test1()) == false);
|
||||
assert(std::any_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia), test1()) == false);
|
||||
}
|
||||
|
||||
#if TEST_STD_VER > 17
|
||||
|
|
|
@ -33,12 +33,12 @@ int main(int, char**)
|
|||
{
|
||||
int ia[] = {0, 1, 2, 2, 0, 1, 2, 3};
|
||||
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
|
||||
assert(std::count(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa), 2) == 3);
|
||||
assert(std::count(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa), 7) == 0);
|
||||
assert(std::count(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia), 2) == 0);
|
||||
assert(std::count(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa), 2) == 3);
|
||||
assert(std::count(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa), 7) == 0);
|
||||
assert(std::count(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia), 2) == 0);
|
||||
|
||||
#if TEST_STD_VER > 17
|
||||
static_assert(test_constexpr());
|
||||
|
|
|
@ -40,14 +40,14 @@ int main(int, char**)
|
|||
{
|
||||
int ia[] = {0, 1, 2, 2, 0, 1, 2, 3};
|
||||
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
|
||||
assert(std::count_if(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa),
|
||||
assert(std::count_if(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa),
|
||||
eq(2)) == 3);
|
||||
assert(std::count_if(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa),
|
||||
assert(std::count_if(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa),
|
||||
eq(7)) == 0);
|
||||
assert(std::count_if(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia),
|
||||
assert(std::count_if(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia),
|
||||
eq(2)) == 0);
|
||||
|
||||
#if TEST_STD_VER > 17
|
||||
|
|
|
@ -29,7 +29,7 @@ TEST_CONSTEXPR bool test_constexpr() {
|
|||
int ia[] = {1, 3, 6, 7};
|
||||
int ib[] = {1, 3};
|
||||
int ic[] = {1, 3, 5, 7};
|
||||
typedef input_iterator<int*> II;
|
||||
typedef cpp17_input_iterator<int*> II;
|
||||
typedef bidirectional_iterator<int*> BI;
|
||||
|
||||
return !std::equal(std::begin(ia), std::end(ia), std::begin(ic))
|
||||
|
@ -49,35 +49,35 @@ int main(int, char**)
|
|||
int ia[] = {0, 1, 2, 3, 4, 5};
|
||||
const unsigned s = sizeof(ia)/sizeof(ia[0]);
|
||||
int ib[s] = {0, 1, 2, 5, 4, 5};
|
||||
assert(std::equal(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ia)));
|
||||
assert(std::equal(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s),
|
||||
cpp17_input_iterator<const int*>(ia)));
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::equal(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s)));
|
||||
assert(std::equal(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s),
|
||||
cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s)));
|
||||
assert(std::equal(random_access_iterator<const int*>(ia),
|
||||
random_access_iterator<const int*>(ia+s),
|
||||
random_access_iterator<const int*>(ia),
|
||||
random_access_iterator<const int*>(ia+s)));
|
||||
#endif
|
||||
assert(!std::equal(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ib)));
|
||||
assert(!std::equal(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s),
|
||||
cpp17_input_iterator<const int*>(ib)));
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(!std::equal(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ib),
|
||||
input_iterator<const int*>(ib+s)));
|
||||
assert(!std::equal(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s),
|
||||
cpp17_input_iterator<const int*>(ib),
|
||||
cpp17_input_iterator<const int*>(ib+s)));
|
||||
assert(!std::equal(random_access_iterator<const int*>(ia),
|
||||
random_access_iterator<const int*>(ia+s),
|
||||
random_access_iterator<const int*>(ib),
|
||||
random_access_iterator<const int*>(ib+s)));
|
||||
assert(!std::equal(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s-1)));
|
||||
assert(!std::equal(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s),
|
||||
cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s-1)));
|
||||
assert(!std::equal(random_access_iterator<const int*>(ia),
|
||||
random_access_iterator<const int*>(ia+s),
|
||||
random_access_iterator<const int*>(ia),
|
||||
|
|
|
@ -36,7 +36,7 @@ TEST_CONSTEXPR bool test_constexpr() {
|
|||
int ia[] = {1, 3, 6, 7};
|
||||
int ib[] = {1, 3};
|
||||
int ic[] = {1, 3, 5, 7};
|
||||
typedef input_iterator<int*> II;
|
||||
typedef cpp17_input_iterator<int*> II;
|
||||
typedef bidirectional_iterator<int*> BI;
|
||||
|
||||
return !std::equal(std::begin(ia), std::end(ia), std::begin(ic) , eq)
|
||||
|
@ -63,15 +63,15 @@ int main(int, char**)
|
|||
int ia[] = {0, 1, 2, 3, 4, 5};
|
||||
const unsigned s = sizeof(ia)/sizeof(ia[0]);
|
||||
int ib[s] = {0, 1, 2, 5, 4, 5};
|
||||
assert(std::equal(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ia),
|
||||
assert(std::equal(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s),
|
||||
cpp17_input_iterator<const int*>(ia),
|
||||
std::equal_to<int>()));
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(std::equal(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
assert(std::equal(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s),
|
||||
cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s),
|
||||
std::equal_to<int>()));
|
||||
assert(std::equal(random_access_iterator<const int*>(ia),
|
||||
random_access_iterator<const int*>(ia+s),
|
||||
|
@ -80,10 +80,10 @@ int main(int, char**)
|
|||
std::equal_to<int>()));
|
||||
|
||||
comparison_count = 0;
|
||||
assert(!std::equal(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s-1),
|
||||
assert(!std::equal(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s),
|
||||
cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s-1),
|
||||
counting_equals<int>));
|
||||
assert(comparison_count > 0);
|
||||
comparison_count = 0;
|
||||
|
@ -94,15 +94,15 @@ int main(int, char**)
|
|||
counting_equals<int>));
|
||||
assert(comparison_count == 0);
|
||||
#endif
|
||||
assert(!std::equal(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ib),
|
||||
assert(!std::equal(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s),
|
||||
cpp17_input_iterator<const int*>(ib),
|
||||
std::equal_to<int>()));
|
||||
#if TEST_STD_VER >= 14
|
||||
assert(!std::equal(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
input_iterator<const int*>(ib),
|
||||
input_iterator<const int*>(ib+s),
|
||||
assert(!std::equal(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s),
|
||||
cpp17_input_iterator<const int*>(ib),
|
||||
cpp17_input_iterator<const int*>(ib+s),
|
||||
std::equal_to<int>()));
|
||||
assert(!std::equal(random_access_iterator<const int*>(ia),
|
||||
random_access_iterator<const int*>(ia+s),
|
||||
|
|
|
@ -44,27 +44,27 @@ int main(int, char**)
|
|||
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
|
||||
int ib[] = {1, 3, 5, 7};
|
||||
const unsigned sb = sizeof(ib)/sizeof(ib[0]);
|
||||
assert(std::find_first_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa),
|
||||
assert(std::find_first_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sb)) ==
|
||||
input_iterator<const int*>(ia+1));
|
||||
cpp17_input_iterator<const int*>(ia+1));
|
||||
int ic[] = {7};
|
||||
assert(std::find_first_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa),
|
||||
assert(std::find_first_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ic),
|
||||
forward_iterator<const int*>(ic + 1)) ==
|
||||
input_iterator<const int*>(ia+sa));
|
||||
assert(std::find_first_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa),
|
||||
cpp17_input_iterator<const int*>(ia+sa));
|
||||
assert(std::find_first_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ic),
|
||||
forward_iterator<const int*>(ic)) ==
|
||||
input_iterator<const int*>(ia+sa));
|
||||
assert(std::find_first_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+sa));
|
||||
assert(std::find_first_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ic),
|
||||
forward_iterator<const int*>(ic+1)) ==
|
||||
input_iterator<const int*>(ia));
|
||||
cpp17_input_iterator<const int*>(ia));
|
||||
|
||||
#if TEST_STD_VER > 17
|
||||
static_assert(test_constexpr());
|
||||
|
|
|
@ -46,31 +46,31 @@ int main(int, char**)
|
|||
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
|
||||
int ib[] = {1, 3, 5, 7};
|
||||
const unsigned sb = sizeof(ib)/sizeof(ib[0]);
|
||||
assert(std::find_first_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa),
|
||||
assert(std::find_first_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sb),
|
||||
std::equal_to<int>()) ==
|
||||
input_iterator<const int*>(ia+1));
|
||||
cpp17_input_iterator<const int*>(ia+1));
|
||||
int ic[] = {7};
|
||||
assert(std::find_first_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa),
|
||||
assert(std::find_first_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ic),
|
||||
forward_iterator<const int*>(ic + 1),
|
||||
std::equal_to<int>()) ==
|
||||
input_iterator<const int*>(ia+sa));
|
||||
assert(std::find_first_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa),
|
||||
cpp17_input_iterator<const int*>(ia+sa));
|
||||
assert(std::find_first_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ic),
|
||||
forward_iterator<const int*>(ic),
|
||||
std::equal_to<int>()) ==
|
||||
input_iterator<const int*>(ia+sa));
|
||||
assert(std::find_first_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+sa));
|
||||
assert(std::find_first_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ic),
|
||||
forward_iterator<const int*>(ic+1),
|
||||
std::equal_to<int>()) ==
|
||||
input_iterator<const int*>(ia));
|
||||
cpp17_input_iterator<const int*>(ia));
|
||||
|
||||
#if TEST_STD_VER > 17
|
||||
static_assert(test_constexpr());
|
||||
|
|
|
@ -33,11 +33,11 @@ int main(int, char**)
|
|||
{
|
||||
int ia[] = {0, 1, 2, 3, 4, 5};
|
||||
const unsigned s = sizeof(ia)/sizeof(ia[0]);
|
||||
input_iterator<const int*> r = std::find(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s), 3);
|
||||
cpp17_input_iterator<const int*> r = std::find(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s), 3);
|
||||
assert(*r == 3);
|
||||
r = std::find(input_iterator<const int*>(ia), input_iterator<const int*>(ia+s), 10);
|
||||
assert(r == input_iterator<const int*>(ia+s));
|
||||
r = std::find(cpp17_input_iterator<const int*>(ia), cpp17_input_iterator<const int*>(ia+s), 10);
|
||||
assert(r == cpp17_input_iterator<const int*>(ia+s));
|
||||
|
||||
#if TEST_STD_VER > 17
|
||||
static_assert(test_constexpr());
|
||||
|
|
|
@ -41,14 +41,14 @@ int main(int, char**)
|
|||
{
|
||||
int ia[] = {0, 1, 2, 3, 4, 5};
|
||||
const unsigned s = sizeof(ia)/sizeof(ia[0]);
|
||||
input_iterator<const int*> r = std::find_if(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
cpp17_input_iterator<const int*> r = std::find_if(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s),
|
||||
eq(3));
|
||||
assert(*r == 3);
|
||||
r = std::find_if(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
r = std::find_if(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s),
|
||||
eq(10));
|
||||
assert(r == input_iterator<const int*>(ia+s));
|
||||
assert(r == cpp17_input_iterator<const int*>(ia+s));
|
||||
|
||||
#if TEST_STD_VER > 17
|
||||
static_assert(test_constexpr());
|
||||
|
|
|
@ -41,14 +41,14 @@ int main(int, char**)
|
|||
{
|
||||
int ia[] = {0, 1, 2, 3, 4, 5};
|
||||
const unsigned s = sizeof(ia)/sizeof(ia[0]);
|
||||
input_iterator<const int*> r = std::find_if_not(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
cpp17_input_iterator<const int*> r = std::find_if_not(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s),
|
||||
ne(3));
|
||||
assert(*r == 3);
|
||||
r = std::find_if_not(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
r = std::find_if_not(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia+s),
|
||||
ne(10));
|
||||
assert(r == input_iterator<const int*>(ia+s));
|
||||
assert(r == cpp17_input_iterator<const int*>(ia+s));
|
||||
|
||||
#if TEST_STD_VER > 17
|
||||
static_assert(test_constexpr());
|
||||
|
|
|
@ -42,7 +42,7 @@ struct for_each_test
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
typedef input_iterator<int*> Iter;
|
||||
typedef cpp17_input_iterator<int*> Iter;
|
||||
int ia[] = {0, 1, 2, 3, 4, 5};
|
||||
const unsigned s = sizeof(ia)/sizeof(ia[0]);
|
||||
|
||||
|
|
|
@ -41,8 +41,8 @@ int main(int, char**)
|
|||
{
|
||||
int ia[] = {0, 1, 2, 3, 4, 5};
|
||||
const unsigned s = sizeof(ia)/sizeof(ia[0]);
|
||||
for_each_test f = std::for_each(input_iterator<int*>(ia),
|
||||
input_iterator<int*>(ia+s),
|
||||
for_each_test f = std::for_each(cpp17_input_iterator<int*>(ia),
|
||||
cpp17_input_iterator<int*>(ia+s),
|
||||
for_each_test(0));
|
||||
assert(f.count == s);
|
||||
for (unsigned i = 0; i < s; ++i)
|
||||
|
|
|
@ -41,26 +41,26 @@ int main(int, char**)
|
|||
{
|
||||
int ia[] = {2, 4, 6, 8};
|
||||
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
|
||||
assert(std::none_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa), test1()) == false);
|
||||
assert(std::none_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia), test1()) == true);
|
||||
assert(std::none_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa), test1()) == false);
|
||||
assert(std::none_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia), test1()) == true);
|
||||
}
|
||||
{
|
||||
const int ia[] = {2, 4, 5, 8};
|
||||
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
|
||||
assert(std::none_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa), test1()) == false);
|
||||
assert(std::none_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia), test1()) == true);
|
||||
assert(std::none_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa), test1()) == false);
|
||||
assert(std::none_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia), test1()) == true);
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 3, 5, 7};
|
||||
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
|
||||
assert(std::none_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia + sa), test1()) == true);
|
||||
assert(std::none_of(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia), test1()) == true);
|
||||
assert(std::none_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia + sa), test1()) == true);
|
||||
assert(std::none_of(cpp17_input_iterator<const int*>(ia),
|
||||
cpp17_input_iterator<const int*>(ia), test1()) == true);
|
||||
}
|
||||
|
||||
#if TEST_STD_VER > 17
|
||||
|
|
|
@ -28,7 +28,7 @@ TEST_CONSTEXPR bool test_constexpr() {
|
|||
int ia[] = {1, 3, 6, 7};
|
||||
int ib[] = {1, 3};
|
||||
int ic[] = {1, 3, 5, 7};
|
||||
typedef input_iterator<int*> II;
|
||||
typedef cpp17_input_iterator<int*> II;
|
||||
typedef bidirectional_iterator<int*> BI;
|
||||
|
||||
auto p1 = std::mismatch(std::begin(ia), std::end(ia), std::begin(ic));
|
||||
|
@ -65,7 +65,7 @@ int main(int, char**)
|
|||
int ib[] = {0, 1, 2, 3, 0, 1, 2, 3};
|
||||
const unsigned sb = sizeof(ib)/sizeof(ib[0]); ((void)sb); // unused in C++11
|
||||
|
||||
typedef input_iterator<const int*> II;
|
||||
typedef cpp17_input_iterator<const int*> II;
|
||||
typedef random_access_iterator<const int*> RAI;
|
||||
|
||||
assert(std::mismatch(II(ia), II(ia + sa), II(ib))
|
||||
|
|
|
@ -33,7 +33,7 @@ TEST_CONSTEXPR bool test_constexpr() {
|
|||
int ia[] = {1, 3, 6, 7};
|
||||
int ib[] = {1, 3};
|
||||
int ic[] = {1, 3, 5, 7};
|
||||
typedef input_iterator<int*> II;
|
||||
typedef cpp17_input_iterator<int*> II;
|
||||
typedef bidirectional_iterator<int*> BI;
|
||||
|
||||
auto p1 = std::mismatch(std::begin(ia), std::end(ia), std::begin(ic), eq);
|
||||
|
@ -75,7 +75,7 @@ int main(int, char**)
|
|||
int ib[] = {0, 1, 2, 3, 0, 1, 2, 3};
|
||||
const unsigned sb = sizeof(ib)/sizeof(ib[0]); ((void)sb); // unused in C++11
|
||||
|
||||
typedef input_iterator<const int*> II;
|
||||
typedef cpp17_input_iterator<const int*> II;
|
||||
typedef random_access_iterator<const int*> RAI;
|
||||
typedef std::equal_to<int> EQ;
|
||||
|
||||
|
|
|
@ -48,31 +48,31 @@ test()
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
test<input_iterator<const int*>, input_iterator<const int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<input_iterator<const int*>, const int*>();
|
||||
test<cpp17_input_iterator<const int*>, cpp17_input_iterator<const int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<cpp17_input_iterator<const int*>, const int*>();
|
||||
|
||||
test<forward_iterator<const int*>, input_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, cpp17_input_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, const int*>();
|
||||
|
||||
test<bidirectional_iterator<const int*>, input_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, cpp17_input_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, const int*>();
|
||||
|
||||
test<random_access_iterator<const int*>, input_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, cpp17_input_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, const int*>();
|
||||
|
||||
test<const int*, input_iterator<const int*> >();
|
||||
test<const int*, cpp17_input_iterator<const int*> >();
|
||||
test<const int*, forward_iterator<const int*> >();
|
||||
test<const int*, bidirectional_iterator<const int*> >();
|
||||
test<const int*, random_access_iterator<const int*> >();
|
||||
|
|
|
@ -53,31 +53,31 @@ test()
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
test<input_iterator<const int*>, input_iterator<const int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<input_iterator<const int*>, const int*>();
|
||||
test<cpp17_input_iterator<const int*>, cpp17_input_iterator<const int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<cpp17_input_iterator<const int*>, const int*>();
|
||||
|
||||
test<forward_iterator<const int*>, input_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, cpp17_input_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, const int*>();
|
||||
|
||||
test<bidirectional_iterator<const int*>, input_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, cpp17_input_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, const int*>();
|
||||
|
||||
test<random_access_iterator<const int*>, input_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, cpp17_input_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, const int*>();
|
||||
|
||||
test<const int*, input_iterator<const int*> >();
|
||||
test<const int*, cpp17_input_iterator<const int*> >();
|
||||
test<const int*, forward_iterator<const int*> >();
|
||||
test<const int*, bidirectional_iterator<const int*> >();
|
||||
test<const int*, random_access_iterator<const int*> >();
|
||||
|
|
|
@ -64,7 +64,7 @@ TEST_CONSTEXPR_CXX20 void test3()
|
|||
template<class T, class Iter1>
|
||||
TEST_CONSTEXPR_CXX20 void test2()
|
||||
{
|
||||
test3<T, Iter1, input_iterator<const T*> >();
|
||||
test3<T, Iter1, cpp17_input_iterator<const T*> >();
|
||||
test3<T, Iter1, forward_iterator<const T*> >();
|
||||
test3<T, Iter1, bidirectional_iterator<const T*> >();
|
||||
test3<T, Iter1, random_access_iterator<const T*> >();
|
||||
|
@ -74,7 +74,7 @@ TEST_CONSTEXPR_CXX20 void test2()
|
|||
template<class T>
|
||||
TEST_CONSTEXPR_CXX20 void test1()
|
||||
{
|
||||
test2<T, input_iterator<const T*> >();
|
||||
test2<T, cpp17_input_iterator<const T*> >();
|
||||
test2<T, forward_iterator<const T*> >();
|
||||
test2<T, bidirectional_iterator<const T*> >();
|
||||
test2<T, random_access_iterator<const T*> >();
|
||||
|
|
|
@ -65,7 +65,7 @@ TEST_CONSTEXPR_CXX20 void test3()
|
|||
template<class T, class Iter1>
|
||||
TEST_CONSTEXPR_CXX20 void test2()
|
||||
{
|
||||
test3<T, Iter1, input_iterator<const T*> >();
|
||||
test3<T, Iter1, cpp17_input_iterator<const T*> >();
|
||||
test3<T, Iter1, forward_iterator<const T*> >();
|
||||
test3<T, Iter1, bidirectional_iterator<const T*> >();
|
||||
test3<T, Iter1, random_access_iterator<const T*> >();
|
||||
|
@ -75,7 +75,7 @@ TEST_CONSTEXPR_CXX20 void test2()
|
|||
template<class T>
|
||||
TEST_CONSTEXPR_CXX20 void test1()
|
||||
{
|
||||
test2<T, input_iterator<const T*> >();
|
||||
test2<T, cpp17_input_iterator<const T*> >();
|
||||
test2<T, forward_iterator<const T*> >();
|
||||
test2<T, bidirectional_iterator<const T*> >();
|
||||
test2<T, random_access_iterator<const T*> >();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
int main(int, char**) {
|
||||
int arr[] = {1, 2, 3};
|
||||
const int *b = std::begin(arr), *e = std::end(arr);
|
||||
typedef input_iterator<const int*> Iter;
|
||||
typedef cpp17_input_iterator<const int*> Iter;
|
||||
{
|
||||
// expected-error@algorithm:* {{"std::min_element requires a ForwardIterator"}}
|
||||
std::min_element(Iter(b), Iter(e));
|
||||
|
|
|
@ -53,31 +53,31 @@ void test()
|
|||
TEST_CONSTEXPR_CXX20
|
||||
bool do_tests()
|
||||
{
|
||||
test<input_iterator<const int*>, input_iterator<const int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<input_iterator<const int*>, const int*>();
|
||||
test<cpp17_input_iterator<const int*>, cpp17_input_iterator<const int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<cpp17_input_iterator<const int*>, const int*>();
|
||||
|
||||
test<forward_iterator<const int*>, input_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, cpp17_input_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, const int*>();
|
||||
|
||||
test<bidirectional_iterator<const int*>, input_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, cpp17_input_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, const int*>();
|
||||
|
||||
test<random_access_iterator<const int*>, input_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, cpp17_input_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, const int*>();
|
||||
|
||||
test<const int*, input_iterator<const int*> >();
|
||||
test<const int*, cpp17_input_iterator<const int*> >();
|
||||
test<const int*, forward_iterator<const int*> >();
|
||||
test<const int*, bidirectional_iterator<const int*> >();
|
||||
test<const int*, random_access_iterator<const int*> >();
|
||||
|
|
|
@ -54,31 +54,31 @@ void test()
|
|||
TEST_CONSTEXPR_CXX20
|
||||
bool do_tests()
|
||||
{
|
||||
test<input_iterator<const int*>, input_iterator<const int*> >();
|
||||
test<input_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<input_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<input_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<input_iterator<const int*>, const int*>();
|
||||
test<cpp17_input_iterator<const int*>, cpp17_input_iterator<const int*> >();
|
||||
test<cpp17_input_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<cpp17_input_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<cpp17_input_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<cpp17_input_iterator<const int*>, const int*>();
|
||||
|
||||
test<forward_iterator<const int*>, input_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, cpp17_input_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<forward_iterator<const int*>, const int*>();
|
||||
|
||||
test<bidirectional_iterator<const int*>, input_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, cpp17_input_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<bidirectional_iterator<const int*>, const int*>();
|
||||
|
||||
test<random_access_iterator<const int*>, input_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, cpp17_input_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, forward_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, bidirectional_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, random_access_iterator<const int*> >();
|
||||
test<random_access_iterator<const int*>, const int*>();
|
||||
|
||||
test<const int*, input_iterator<const int*> >();
|
||||
test<const int*, cpp17_input_iterator<const int*> >();
|
||||
test<const int*, forward_iterator<const int*> >();
|
||||
test<const int*, bidirectional_iterator<const int*> >();
|
||||
test<const int*, random_access_iterator<const int*> >();
|
||||
|
|
|
@ -64,7 +64,7 @@ TEST_CONSTEXPR_CXX20 void test3()
|
|||
template<class T, class Iter1>
|
||||
TEST_CONSTEXPR_CXX20 void test2()
|
||||
{
|
||||
test3<T, Iter1, input_iterator<const T*> >();
|
||||
test3<T, Iter1, cpp17_input_iterator<const T*> >();
|
||||
test3<T, Iter1, forward_iterator<const T*> >();
|
||||
test3<T, Iter1, bidirectional_iterator<const T*> >();
|
||||
test3<T, Iter1, random_access_iterator<const T*> >();
|
||||
|
@ -74,7 +74,7 @@ TEST_CONSTEXPR_CXX20 void test2()
|
|||
template<class T>
|
||||
TEST_CONSTEXPR_CXX20 void test1()
|
||||
{
|
||||
test2<T, input_iterator<const T*> >();
|
||||
test2<T, cpp17_input_iterator<const T*> >();
|
||||
test2<T, forward_iterator<const T*> >();
|
||||
test2<T, bidirectional_iterator<const T*> >();
|
||||
test2<T, random_access_iterator<const T*> >();
|
||||
|
|
|
@ -65,7 +65,7 @@ TEST_CONSTEXPR_CXX20 void test3()
|
|||
template<class T, class Iter1>
|
||||
TEST_CONSTEXPR_CXX20 void test2()
|
||||
{
|
||||
test3<T, Iter1, input_iterator<const T*> >();
|
||||
test3<T, Iter1, cpp17_input_iterator<const T*> >();
|
||||
test3<T, Iter1, forward_iterator<const T*> >();
|
||||
test3<T, Iter1, bidirectional_iterator<const T*> >();
|
||||
test3<T, Iter1, random_access_iterator<const T*> >();
|
||||
|
@ -75,7 +75,7 @@ TEST_CONSTEXPR_CXX20 void test2()
|
|||
template<class T>
|
||||
TEST_CONSTEXPR_CXX20 void test1()
|
||||
{
|
||||
test2<T, input_iterator<const T*> >();
|
||||
test2<T, cpp17_input_iterator<const T*> >();
|
||||
test2<T, forward_iterator<const T*> >();
|
||||
test2<T, bidirectional_iterator<const T*> >();
|
||||
test2<T, random_access_iterator<const T*> >();
|
||||
|
|
|
@ -62,7 +62,7 @@ TEST_CONSTEXPR_CXX20 void test3()
|
|||
template<class T, class Iter1>
|
||||
TEST_CONSTEXPR_CXX20 void test2()
|
||||
{
|
||||
test3<T, Iter1, input_iterator<const T*> >();
|
||||
test3<T, Iter1, cpp17_input_iterator<const T*> >();
|
||||
test3<T, Iter1, forward_iterator<const T*> >();
|
||||
test3<T, Iter1, bidirectional_iterator<const T*> >();
|
||||
test3<T, Iter1, random_access_iterator<const T*> >();
|
||||
|
@ -72,7 +72,7 @@ TEST_CONSTEXPR_CXX20 void test2()
|
|||
template<class T>
|
||||
TEST_CONSTEXPR_CXX20 void test1()
|
||||
{
|
||||
test2<T, input_iterator<const T*> >();
|
||||
test2<T, cpp17_input_iterator<const T*> >();
|
||||
test2<T, forward_iterator<const T*> >();
|
||||
test2<T, bidirectional_iterator<const T*> >();
|
||||
test2<T, random_access_iterator<const T*> >();
|
||||
|
|
|
@ -63,7 +63,7 @@ TEST_CONSTEXPR_CXX20 void test3()
|
|||
template<class T, class Iter1>
|
||||
TEST_CONSTEXPR_CXX20 void test2()
|
||||
{
|
||||
test3<T, Iter1, input_iterator<const T*> >();
|
||||
test3<T, Iter1, cpp17_input_iterator<const T*> >();
|
||||
test3<T, Iter1, forward_iterator<const T*> >();
|
||||
test3<T, Iter1, bidirectional_iterator<const T*> >();
|
||||
test3<T, Iter1, random_access_iterator<const T*> >();
|
||||
|
@ -73,7 +73,7 @@ TEST_CONSTEXPR_CXX20 void test2()
|
|||
template<class T>
|
||||
TEST_CONSTEXPR_CXX20 void test1()
|
||||
{
|
||||
test2<T, input_iterator<const T*> >();
|
||||
test2<T, cpp17_input_iterator<const T*> >();
|
||||
test2<T, forward_iterator<const T*> >();
|
||||
test2<T, bidirectional_iterator<const T*> >();
|
||||
test2<T, random_access_iterator<const T*> >();
|
||||
|
|
|
@ -64,7 +64,7 @@ TEST_CONSTEXPR_CXX20 void test3()
|
|||
template<class T, class Iter1>
|
||||
TEST_CONSTEXPR_CXX20 void test2()
|
||||
{
|
||||
test3<T, Iter1, input_iterator<const T*> >();
|
||||
test3<T, Iter1, cpp17_input_iterator<const T*> >();
|
||||
test3<T, Iter1, forward_iterator<const T*> >();
|
||||
test3<T, Iter1, bidirectional_iterator<const T*> >();
|
||||
test3<T, Iter1, random_access_iterator<const T*> >();
|
||||
|
@ -74,7 +74,7 @@ TEST_CONSTEXPR_CXX20 void test2()
|
|||
template<class T>
|
||||
TEST_CONSTEXPR_CXX20 void test1()
|
||||
{
|
||||
test2<T, input_iterator<const T*> >();
|
||||
test2<T, cpp17_input_iterator<const T*> >();
|
||||
test2<T, forward_iterator<const T*> >();
|
||||
test2<T, bidirectional_iterator<const T*> >();
|
||||
test2<T, random_access_iterator<const T*> >();
|
||||
|
|
|
@ -65,7 +65,7 @@ TEST_CONSTEXPR_CXX20 void test3()
|
|||
template<class T, class Iter1>
|
||||
TEST_CONSTEXPR_CXX20 void test2()
|
||||
{
|
||||
test3<T, Iter1, input_iterator<const T*> >();
|
||||
test3<T, Iter1, cpp17_input_iterator<const T*> >();
|
||||
test3<T, Iter1, forward_iterator<const T*> >();
|
||||
test3<T, Iter1, bidirectional_iterator<const T*> >();
|
||||
test3<T, Iter1, random_access_iterator<const T*> >();
|
||||
|
@ -75,7 +75,7 @@ TEST_CONSTEXPR_CXX20 void test2()
|
|||
template<class T>
|
||||
TEST_CONSTEXPR_CXX20 void test1()
|
||||
{
|
||||
test2<T, input_iterator<const T*> >();
|
||||
test2<T, cpp17_input_iterator<const T*> >();
|
||||
test2<T, forward_iterator<const T*> >();
|
||||
test2<T, bidirectional_iterator<const T*> >();
|
||||
test2<T, random_access_iterator<const T*> >();
|
||||
|
|
|
@ -64,7 +64,7 @@ TEST_CONSTEXPR_CXX20 void test3()
|
|||
template<class T, class Iter1>
|
||||
TEST_CONSTEXPR_CXX20 void test2()
|
||||
{
|
||||
test3<T, Iter1, input_iterator<const T*> >();
|
||||
test3<T, Iter1, cpp17_input_iterator<const T*> >();
|
||||
test3<T, Iter1, forward_iterator<const T*> >();
|
||||
test3<T, Iter1, bidirectional_iterator<const T*> >();
|
||||
test3<T, Iter1, random_access_iterator<const T*> >();
|
||||
|
@ -74,7 +74,7 @@ TEST_CONSTEXPR_CXX20 void test2()
|
|||
template<class T>
|
||||
TEST_CONSTEXPR_CXX20 void test1()
|
||||
{
|
||||
test2<T, input_iterator<const T*> >();
|
||||
test2<T, cpp17_input_iterator<const T*> >();
|
||||
test2<T, forward_iterator<const T*> >();
|
||||
test2<T, bidirectional_iterator<const T*> >();
|
||||
test2<T, random_access_iterator<const T*> >();
|
||||
|
|
|
@ -65,7 +65,7 @@ TEST_CONSTEXPR_CXX20 void test3()
|
|||
template<class T, class Iter1>
|
||||
TEST_CONSTEXPR_CXX20 void test2()
|
||||
{
|
||||
test3<T, Iter1, input_iterator<const T*> >();
|
||||
test3<T, Iter1, cpp17_input_iterator<const T*> >();
|
||||
test3<T, Iter1, forward_iterator<const T*> >();
|
||||
test3<T, Iter1, bidirectional_iterator<const T*> >();
|
||||
test3<T, Iter1, random_access_iterator<const T*> >();
|
||||
|
@ -75,7 +75,7 @@ TEST_CONSTEXPR_CXX20 void test2()
|
|||
template<class T>
|
||||
TEST_CONSTEXPR_CXX20 void test1()
|
||||
{
|
||||
test2<T, input_iterator<const T*> >();
|
||||
test2<T, cpp17_input_iterator<const T*> >();
|
||||
test2<T, forward_iterator<const T*> >();
|
||||
test2<T, bidirectional_iterator<const T*> >();
|
||||
test2<T, random_access_iterator<const T*> >();
|
||||
|
|
|
@ -38,7 +38,7 @@ int main(int, char**)
|
|||
P(3, 2),
|
||||
};
|
||||
M m;
|
||||
m.insert(input_iterator<P*>(ar), input_iterator<P*>(ar + sizeof(ar)/sizeof(ar[0])));
|
||||
m.insert(cpp17_input_iterator<P*>(ar), cpp17_input_iterator<P*>(ar + sizeof(ar)/sizeof(ar[0])));
|
||||
assert(m.size() == 3);
|
||||
assert(m.begin()->first == 1);
|
||||
assert(m.begin()->second == 1);
|
||||
|
@ -64,7 +64,7 @@ int main(int, char**)
|
|||
P(3, 2),
|
||||
};
|
||||
M m;
|
||||
m.insert(input_iterator<P*>(ar), input_iterator<P*>(ar + sizeof(ar)/sizeof(ar[0])));
|
||||
m.insert(cpp17_input_iterator<P*>(ar), cpp17_input_iterator<P*>(ar + sizeof(ar)/sizeof(ar[0])));
|
||||
assert(m.size() == 3);
|
||||
assert(m.begin()->first == 1);
|
||||
assert(m.begin()->second == 1);
|
||||
|
|
|
@ -38,7 +38,7 @@ int main(int, char**)
|
|||
P(3, 2),
|
||||
};
|
||||
M m;
|
||||
m.insert(input_iterator<P*>(ar), input_iterator<P*>(ar + sizeof(ar)/sizeof(ar[0])));
|
||||
m.insert(cpp17_input_iterator<P*>(ar), cpp17_input_iterator<P*>(ar + sizeof(ar)/sizeof(ar[0])));
|
||||
assert(m.size() == 9);
|
||||
assert(m.begin()->first == 1);
|
||||
assert(m.begin()->second == 1);
|
||||
|
@ -76,7 +76,7 @@ int main(int, char**)
|
|||
P(3, 2),
|
||||
};
|
||||
M m;
|
||||
m.insert(input_iterator<P*>(ar), input_iterator<P*>(ar + sizeof(ar)/sizeof(ar[0])));
|
||||
m.insert(cpp17_input_iterator<P*>(ar), cpp17_input_iterator<P*>(ar + sizeof(ar)/sizeof(ar[0])));
|
||||
assert(m.size() == 9);
|
||||
assert(m.begin()->first == 1);
|
||||
assert(m.begin()->second == 1);
|
||||
|
|
|
@ -38,8 +38,8 @@ int main(int, char**)
|
|||
3
|
||||
};
|
||||
M m;
|
||||
m.insert(input_iterator<const V*>(ar),
|
||||
input_iterator<const V*>(ar + sizeof(ar)/sizeof(ar[0])));
|
||||
m.insert(cpp17_input_iterator<const V*>(ar),
|
||||
cpp17_input_iterator<const V*>(ar + sizeof(ar)/sizeof(ar[0])));
|
||||
assert(m.size() == 9);
|
||||
assert(*next(m.begin(), 0) == 1);
|
||||
assert(*next(m.begin(), 1) == 1);
|
||||
|
@ -68,8 +68,8 @@ int main(int, char**)
|
|||
3
|
||||
};
|
||||
M m;
|
||||
m.insert(input_iterator<const V*>(ar),
|
||||
input_iterator<const V*>(ar + sizeof(ar)/sizeof(ar[0])));
|
||||
m.insert(cpp17_input_iterator<const V*>(ar),
|
||||
cpp17_input_iterator<const V*>(ar + sizeof(ar)/sizeof(ar[0])));
|
||||
assert(m.size() == 9);
|
||||
assert(*next(m.begin(), 0) == 1);
|
||||
assert(*next(m.begin(), 1) == 1);
|
||||
|
|
|
@ -36,8 +36,8 @@ int main(int, char**)
|
|||
3,
|
||||
3
|
||||
};
|
||||
std::multiset<V> m(input_iterator<const int*>(ar),
|
||||
input_iterator<const int*>(ar+sizeof(ar)/sizeof(ar[0])));
|
||||
std::multiset<V> m(cpp17_input_iterator<const int*>(ar),
|
||||
cpp17_input_iterator<const int*>(ar+sizeof(ar)/sizeof(ar[0])));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 9);
|
||||
assert(*next(m.begin(), 0) == 1);
|
||||
|
@ -65,8 +65,8 @@ int main(int, char**)
|
|||
3,
|
||||
3
|
||||
};
|
||||
std::multiset<V, std::less<V>, min_allocator<V>> m(input_iterator<const int*>(ar),
|
||||
input_iterator<const int*>(ar+sizeof(ar)/sizeof(ar[0])));
|
||||
std::multiset<V, std::less<V>, min_allocator<V>> m(cpp17_input_iterator<const int*>(ar),
|
||||
cpp17_input_iterator<const int*>(ar+sizeof(ar)/sizeof(ar[0])));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 9);
|
||||
assert(*next(m.begin(), 0) == 1);
|
||||
|
|
|
@ -40,8 +40,8 @@ int main(int, char**)
|
|||
};
|
||||
typedef test_compare<std::less<V> > C;
|
||||
typedef test_allocator<V> A;
|
||||
std::multiset<V, C, A> m(input_iterator<const V*>(ar),
|
||||
input_iterator<const V*>(ar+sizeof(ar)/sizeof(ar[0])),
|
||||
std::multiset<V, C, A> m(cpp17_input_iterator<const V*>(ar),
|
||||
cpp17_input_iterator<const V*>(ar+sizeof(ar)/sizeof(ar[0])),
|
||||
C(5), A(7));
|
||||
assert(m.value_comp() == C(5));
|
||||
assert(m.get_allocator() == A(7));
|
||||
|
|
|
@ -36,8 +36,8 @@ int main(int, char**)
|
|||
3
|
||||
};
|
||||
typedef test_compare<std::less<V> > C;
|
||||
std::multiset<V, C> m(input_iterator<const V*>(ar),
|
||||
input_iterator<const V*>(ar+sizeof(ar)/sizeof(ar[0])), C(5));
|
||||
std::multiset<V, C> m(cpp17_input_iterator<const V*>(ar),
|
||||
cpp17_input_iterator<const V*>(ar+sizeof(ar)/sizeof(ar[0])), C(5));
|
||||
assert(m.value_comp() == C(5));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 9);
|
||||
|
|
|
@ -38,8 +38,8 @@ int main(int, char**)
|
|||
3
|
||||
};
|
||||
M m;
|
||||
m.insert(input_iterator<const V*>(ar),
|
||||
input_iterator<const V*>(ar + sizeof(ar)/sizeof(ar[0])));
|
||||
m.insert(cpp17_input_iterator<const V*>(ar),
|
||||
cpp17_input_iterator<const V*>(ar + sizeof(ar)/sizeof(ar[0])));
|
||||
assert(m.size() == 3);
|
||||
assert(*m.begin() == 1);
|
||||
assert(*next(m.begin()) == 2);
|
||||
|
@ -62,8 +62,8 @@ int main(int, char**)
|
|||
3
|
||||
};
|
||||
M m;
|
||||
m.insert(input_iterator<const V*>(ar),
|
||||
input_iterator<const V*>(ar + sizeof(ar)/sizeof(ar[0])));
|
||||
m.insert(cpp17_input_iterator<const V*>(ar),
|
||||
cpp17_input_iterator<const V*>(ar + sizeof(ar)/sizeof(ar[0])));
|
||||
assert(m.size() == 3);
|
||||
assert(*m.begin() == 1);
|
||||
assert(*next(m.begin()) == 2);
|
||||
|
|
|
@ -36,8 +36,8 @@ int main(int, char**)
|
|||
3,
|
||||
3
|
||||
};
|
||||
std::set<V> m(input_iterator<const int*>(ar),
|
||||
input_iterator<const int*>(ar+sizeof(ar)/sizeof(ar[0])));
|
||||
std::set<V> m(cpp17_input_iterator<const int*>(ar),
|
||||
cpp17_input_iterator<const int*>(ar+sizeof(ar)/sizeof(ar[0])));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 3);
|
||||
assert(*m.begin() == 1);
|
||||
|
@ -59,8 +59,8 @@ int main(int, char**)
|
|||
3,
|
||||
3
|
||||
};
|
||||
std::set<V, std::less<int>, min_allocator<int>> m(input_iterator<const int*>(ar),
|
||||
input_iterator<const int*>(ar+sizeof(ar)/sizeof(ar[0])));
|
||||
std::set<V, std::less<int>, min_allocator<int>> m(cpp17_input_iterator<const int*>(ar),
|
||||
cpp17_input_iterator<const int*>(ar+sizeof(ar)/sizeof(ar[0])));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 3);
|
||||
assert(*m.begin() == 1);
|
||||
|
|
|
@ -44,8 +44,8 @@ int main(int, char**)
|
|||
};
|
||||
typedef test_compare<std::less<V> > C;
|
||||
typedef test_allocator<V> A;
|
||||
std::set<V, C, A> m(input_iterator<const V*>(ar),
|
||||
input_iterator<const V*>(ar+sizeof(ar)/sizeof(ar[0])),
|
||||
std::set<V, C, A> m(cpp17_input_iterator<const V*>(ar),
|
||||
cpp17_input_iterator<const V*>(ar+sizeof(ar)/sizeof(ar[0])),
|
||||
C(5), A(7));
|
||||
assert(m.value_comp() == C(5));
|
||||
assert(m.get_allocator() == A(7));
|
||||
|
|
|
@ -36,8 +36,8 @@ int main(int, char**)
|
|||
3
|
||||
};
|
||||
typedef test_compare<std::less<V> > C;
|
||||
std::set<V, C> m(input_iterator<const V*>(ar),
|
||||
input_iterator<const V*>(ar+sizeof(ar)/sizeof(ar[0])), C(5));
|
||||
std::set<V, C> m(cpp17_input_iterator<const V*>(ar),
|
||||
cpp17_input_iterator<const V*>(ar+sizeof(ar)/sizeof(ar[0])), C(5));
|
||||
assert(m.value_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 3);
|
||||
|
|
|
@ -67,7 +67,7 @@ void
|
|||
testI(C& c1, const C& c2)
|
||||
{
|
||||
typedef typename C::const_iterator CI;
|
||||
typedef input_iterator<CI> ICI;
|
||||
typedef cpp17_input_iterator<CI> ICI;
|
||||
c1.assign(ICI(c2.begin()), ICI(c2.end()));
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(c1 == c2);
|
||||
|
@ -128,7 +128,7 @@ void test_emplacable_concept() {
|
|||
}
|
||||
{
|
||||
using T = EmplaceConstructibleMoveableAndAssignable<int>;
|
||||
using It = input_iterator<int*>;
|
||||
using It = cpp17_input_iterator<int*>;
|
||||
{
|
||||
std::deque<T> v;
|
||||
v.assign(It(arr1), It(std::end(arr1)));
|
||||
|
|
|
@ -55,7 +55,7 @@ void basic_test()
|
|||
{
|
||||
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
|
||||
int* an = ab + sizeof(ab)/sizeof(ab[0]);
|
||||
test(input_iterator<const int*>(ab), input_iterator<const int*>(an));
|
||||
test(cpp17_input_iterator<const int*>(ab), cpp17_input_iterator<const int*>(an));
|
||||
test(forward_iterator<const int*>(ab), forward_iterator<const int*>(an));
|
||||
test(bidirectional_iterator<const int*>(ab), bidirectional_iterator<const int*>(an));
|
||||
test(random_access_iterator<const int*>(ab), random_access_iterator<const int*>(an));
|
||||
|
@ -86,7 +86,7 @@ void test_emplacable_concept() {
|
|||
}
|
||||
{
|
||||
using T = EmplaceConstructibleAndMoveable<int>;
|
||||
using It = input_iterator<int*>;
|
||||
using It = cpp17_input_iterator<int*>;
|
||||
{
|
||||
std::deque<T> v(It(arr1), It(std::end(arr1)));
|
||||
assert(v[0].copied == 0);
|
||||
|
|
|
@ -42,12 +42,12 @@ void basic_test()
|
|||
{
|
||||
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
|
||||
int* an = ab + sizeof(ab)/sizeof(ab[0]);
|
||||
test(input_iterator<const int*>(ab), input_iterator<const int*>(an), test_allocator<int>(3));
|
||||
test(cpp17_input_iterator<const int*>(ab), cpp17_input_iterator<const int*>(an), test_allocator<int>(3));
|
||||
test(forward_iterator<const int*>(ab), forward_iterator<const int*>(an), test_allocator<int>(4));
|
||||
test(bidirectional_iterator<const int*>(ab), bidirectional_iterator<const int*>(an), test_allocator<int>(5));
|
||||
test(random_access_iterator<const int*>(ab), random_access_iterator<const int*>(an), test_allocator<int>(6));
|
||||
#if TEST_STD_VER >= 11
|
||||
test(input_iterator<const int*>(ab), input_iterator<const int*>(an), min_allocator<int>());
|
||||
test(cpp17_input_iterator<const int*>(ab), cpp17_input_iterator<const int*>(an), min_allocator<int>());
|
||||
test(forward_iterator<const int*>(ab), forward_iterator<const int*>(an), min_allocator<int>());
|
||||
test(bidirectional_iterator<const int*>(ab), bidirectional_iterator<const int*>(an), min_allocator<int>());
|
||||
test(random_access_iterator<const int*>(ab), random_access_iterator<const int*>(an), min_allocator<int>());
|
||||
|
@ -76,7 +76,7 @@ void test_emplacable_concept() {
|
|||
}
|
||||
{
|
||||
using T = EmplaceConstructibleAndMoveable<int>;
|
||||
using It = input_iterator<int*>;
|
||||
using It = cpp17_input_iterator<int*>;
|
||||
std::allocator<T> a;
|
||||
{
|
||||
std::deque<T> v(It(arr1), It(std::end(arr1)), a);
|
||||
|
|
|
@ -51,7 +51,7 @@ test(int P, const C& c0, const C& c2)
|
|||
{
|
||||
{
|
||||
typedef typename C::const_iterator CI;
|
||||
typedef input_iterator<CI> BCI;
|
||||
typedef cpp17_input_iterator<CI> BCI;
|
||||
C c1 = c0;
|
||||
std::size_t c1_osize = c1.size();
|
||||
CI i = c1.insert(c1.begin() + P, BCI(c2.begin()), BCI(c2.end()));
|
||||
|
@ -167,7 +167,7 @@ void
|
|||
testI(int P, C& c1, const C& c2)
|
||||
{
|
||||
typedef typename C::const_iterator CI;
|
||||
typedef input_iterator<CI> ICI;
|
||||
typedef cpp17_input_iterator<CI> ICI;
|
||||
std::size_t c1_osize = c1.size();
|
||||
CI i = c1.insert(c1.begin() + P, ICI(c2.begin()), ICI(c2.end()));
|
||||
assert(i == c1.begin() + P);
|
||||
|
@ -250,7 +250,7 @@ test_move()
|
|||
assert(*i == MoveOnly(j));
|
||||
{
|
||||
MoveOnly mo(1);
|
||||
typedef input_iterator<MoveOnly*> I;
|
||||
typedef cpp17_input_iterator<MoveOnly*> I;
|
||||
c.insert(c.end(), std::move_iterator<I>(I(&mo)), std::move_iterator<I>(I(&mo+1)));
|
||||
}
|
||||
j = 0;
|
||||
|
|
|
@ -50,7 +50,7 @@ void testN(int start, int N)
|
|||
typedef typename C::const_iterator CI;
|
||||
typedef random_access_iterator<I> RAI;
|
||||
typedef random_access_iterator<CI> RACI;
|
||||
typedef input_iterator<CI> ICI;
|
||||
typedef cpp17_input_iterator<CI> ICI;
|
||||
C c1 = make<C>(N, start);
|
||||
C c2 = make<C>(N);
|
||||
assert(std::copy(c1.cbegin(), c1.cend(), c2.begin()) == c2.end());
|
||||
|
|
|
@ -27,7 +27,7 @@ int main(int, char**)
|
|||
const T t0[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
const T t1[] = {10, 11, 12, 13};
|
||||
C c(std::begin(t1), std::end(t1));
|
||||
typedef input_iterator<const T*> I;
|
||||
typedef cpp17_input_iterator<const T*> I;
|
||||
c.assign(I(std::begin(t0)), I(std::end(t0)));
|
||||
int n = 0;
|
||||
for (C::const_iterator i = c.cbegin(); i != c.cend(); ++i, ++n)
|
||||
|
@ -40,7 +40,7 @@ int main(int, char**)
|
|||
const T t0[] = {10, 11, 12, 13};
|
||||
const T t1[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
C c(std::begin(t1), std::end(t1));
|
||||
typedef input_iterator<const T*> I;
|
||||
typedef cpp17_input_iterator<const T*> I;
|
||||
c.assign(I(std::begin(t0)), I(std::end(t0)));
|
||||
int n = 0;
|
||||
for (C::const_iterator i = c.cbegin(); i != c.cend(); ++i, ++n)
|
||||
|
@ -54,7 +54,7 @@ int main(int, char**)
|
|||
const T t0[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
const T t1[] = {10, 11, 12, 13};
|
||||
C c(std::begin(t1), std::end(t1));
|
||||
typedef input_iterator<const T*> I;
|
||||
typedef cpp17_input_iterator<const T*> I;
|
||||
c.assign(I(std::begin(t0)), I(std::end(t0)));
|
||||
int n = 0;
|
||||
for (C::const_iterator i = c.cbegin(); i != c.cend(); ++i, ++n)
|
||||
|
@ -67,7 +67,7 @@ int main(int, char**)
|
|||
const T t0[] = {10, 11, 12, 13};
|
||||
const T t1[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
C c(std::begin(t1), std::end(t1));
|
||||
typedef input_iterator<const T*> I;
|
||||
typedef cpp17_input_iterator<const T*> I;
|
||||
c.assign(I(std::begin(t0)), I(std::end(t0)));
|
||||
int n = 0;
|
||||
for (C::const_iterator i = c.cbegin(); i != c.cend(); ++i, (void) ++n)
|
||||
|
|
|
@ -24,7 +24,7 @@ int main(int, char**)
|
|||
{
|
||||
typedef int T;
|
||||
typedef std::forward_list<T> C;
|
||||
typedef input_iterator<const T*> I;
|
||||
typedef cpp17_input_iterator<const T*> I;
|
||||
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
C c(I(std::begin(t)), I(std::end(t)));
|
||||
int n = 0;
|
||||
|
@ -36,7 +36,7 @@ int main(int, char**)
|
|||
{
|
||||
typedef int T;
|
||||
typedef std::forward_list<T, min_allocator<T>> C;
|
||||
typedef input_iterator<const T*> I;
|
||||
typedef cpp17_input_iterator<const T*> I;
|
||||
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
C c(I(std::begin(t)), I(std::end(t)));
|
||||
int n = 0;
|
||||
|
|
|
@ -27,7 +27,7 @@ int main(int, char**)
|
|||
typedef int T;
|
||||
typedef test_allocator<T> A;
|
||||
typedef std::forward_list<T, A> C;
|
||||
typedef input_iterator<const T*> I;
|
||||
typedef cpp17_input_iterator<const T*> I;
|
||||
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
C c(I(std::begin(t)), I(std::end(t)), A(13));
|
||||
int n = 0;
|
||||
|
@ -41,7 +41,7 @@ int main(int, char**)
|
|||
typedef int T;
|
||||
typedef min_allocator<T> A;
|
||||
typedef std::forward_list<T, A> C;
|
||||
typedef input_iterator<const T*> I;
|
||||
typedef cpp17_input_iterator<const T*> I;
|
||||
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
C c(I(std::begin(t)), I(std::end(t)), A());
|
||||
int n = 0;
|
||||
|
|
|
@ -25,7 +25,7 @@ int main(int, char**)
|
|||
typedef int T;
|
||||
typedef std::forward_list<T> C;
|
||||
typedef C::iterator I;
|
||||
typedef input_iterator<const T*> J;
|
||||
typedef cpp17_input_iterator<const T*> J;
|
||||
C c;
|
||||
const T t[] = {0, 1, 2, 3, 4};
|
||||
I i = c.insert_after(c.cbefore_begin(), J(t), J(t));
|
||||
|
@ -53,7 +53,7 @@ int main(int, char**)
|
|||
typedef int T;
|
||||
typedef std::forward_list<T, min_allocator<T>> C;
|
||||
typedef C::iterator I;
|
||||
typedef input_iterator<const T*> J;
|
||||
typedef cpp17_input_iterator<const T*> J;
|
||||
C c;
|
||||
const T t[] = {0, 1, 2, 3, 4};
|
||||
I i = c.insert_after(c.cbefore_begin(), J(t), J(t));
|
||||
|
|
|
@ -26,8 +26,8 @@ void basic_test()
|
|||
{
|
||||
{
|
||||
int a[] = {0, 1, 2, 3};
|
||||
std::list<int> l(input_iterator<const int*>(a),
|
||||
input_iterator<const int*>(a + sizeof(a)/sizeof(a[0])));
|
||||
std::list<int> l(cpp17_input_iterator<const int*>(a),
|
||||
cpp17_input_iterator<const int*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(l.size() == sizeof(a)/sizeof(a[0]));
|
||||
assert(std::distance(l.begin(), l.end()) == sizeof(a)/sizeof(a[0]));
|
||||
int j = 0;
|
||||
|
@ -36,8 +36,8 @@ void basic_test()
|
|||
}
|
||||
{
|
||||
int a[] = {0, 1, 2, 3};
|
||||
std::list<int> l(input_iterator<const int*>(a),
|
||||
input_iterator<const int*>(a + sizeof(a)/sizeof(a[0])),
|
||||
std::list<int> l(cpp17_input_iterator<const int*>(a),
|
||||
cpp17_input_iterator<const int*>(a + sizeof(a)/sizeof(a[0])),
|
||||
std::allocator<int>());
|
||||
assert(l.size() == sizeof(a)/sizeof(a[0]));
|
||||
assert(std::distance(l.begin(), l.end()) == sizeof(a)/sizeof(a[0]));
|
||||
|
@ -48,8 +48,8 @@ void basic_test()
|
|||
{
|
||||
int a[] = {0, 1, 2, 3};
|
||||
// Add 2 for implementations that dynamically allocate a sentinel node and container proxy.
|
||||
std::list<int, limited_allocator<int, sizeof(a)/sizeof(a[0]) + 2> > l(input_iterator<const int*>(a),
|
||||
input_iterator<const int*>(a + sizeof(a)/sizeof(a[0])));
|
||||
std::list<int, limited_allocator<int, sizeof(a)/sizeof(a[0]) + 2> > l(cpp17_input_iterator<const int*>(a),
|
||||
cpp17_input_iterator<const int*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(l.size() == sizeof(a)/sizeof(a[0]));
|
||||
assert(std::distance(l.begin(), l.end()) == sizeof(a)/sizeof(a[0]));
|
||||
int j = 0;
|
||||
|
@ -59,8 +59,8 @@ void basic_test()
|
|||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
int a[] = {0, 1, 2, 3};
|
||||
std::list<int, min_allocator<int>> l(input_iterator<const int*>(a),
|
||||
input_iterator<const int*>(a + sizeof(a)/sizeof(a[0])));
|
||||
std::list<int, min_allocator<int>> l(cpp17_input_iterator<const int*>(a),
|
||||
cpp17_input_iterator<const int*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(l.size() == sizeof(a)/sizeof(a[0]));
|
||||
assert(std::distance(l.begin(), l.end()) == sizeof(a)/sizeof(a[0]));
|
||||
int j = 0;
|
||||
|
@ -69,8 +69,8 @@ void basic_test()
|
|||
}
|
||||
{
|
||||
int a[] = {0, 1, 2, 3};
|
||||
std::list<int, min_allocator<int>> l(input_iterator<const int*>(a),
|
||||
input_iterator<const int*>(a + sizeof(a)/sizeof(a[0])),
|
||||
std::list<int, min_allocator<int>> l(cpp17_input_iterator<const int*>(a),
|
||||
cpp17_input_iterator<const int*>(a + sizeof(a)/sizeof(a[0])),
|
||||
min_allocator<int>());
|
||||
assert(l.size() == sizeof(a)/sizeof(a[0]));
|
||||
assert(std::distance(l.begin(), l.end()) == sizeof(a)/sizeof(a[0]));
|
||||
|
@ -107,7 +107,7 @@ void test_emplacable_concept() {
|
|||
}
|
||||
{
|
||||
using T = EmplaceConstructible<int>;
|
||||
using It = input_iterator<int*>;
|
||||
using It = cpp17_input_iterator<int*>;
|
||||
{
|
||||
std::list<T> v(It(arr1), It(std::end(arr1)));
|
||||
auto I = v.begin();
|
||||
|
@ -155,7 +155,7 @@ void test_emplacable_concept_with_alloc() {
|
|||
}
|
||||
{
|
||||
using T = EmplaceConstructible<int>;
|
||||
using It = input_iterator<int*>;
|
||||
using It = cpp17_input_iterator<int*>;
|
||||
std::allocator<T> a;
|
||||
{
|
||||
std::list<T> v(It(arr1), It(std::end(arr1)), a);
|
||||
|
@ -195,7 +195,7 @@ void test_ctor_under_alloc() {
|
|||
}
|
||||
{
|
||||
using C = TCT::list<>;
|
||||
using It = input_iterator<int*>;
|
||||
using It = cpp17_input_iterator<int*>;
|
||||
{
|
||||
ExpectConstructGuard<int&> G(1);
|
||||
C v(It(arr1), It(std::end(arr1)));
|
||||
|
@ -228,7 +228,7 @@ void test_ctor_under_alloc_with_alloc() {
|
|||
}
|
||||
{
|
||||
using C = TCT::list<>;
|
||||
using It = input_iterator<int*>;
|
||||
using It = cpp17_input_iterator<int*>;
|
||||
using Alloc = typename C::allocator_type;
|
||||
Alloc a;
|
||||
{
|
||||
|
|
|
@ -34,13 +34,13 @@ int main(int, char**)
|
|||
{
|
||||
bool a[] = {0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0};
|
||||
bool* an = a + sizeof(a)/sizeof(a[0]);
|
||||
test<std::vector<bool> >(input_iterator<const bool*>(a), input_iterator<const bool*>(an));
|
||||
test<std::vector<bool> >(cpp17_input_iterator<const bool*>(a), cpp17_input_iterator<const bool*>(an));
|
||||
test<std::vector<bool> >(forward_iterator<const bool*>(a), forward_iterator<const bool*>(an));
|
||||
test<std::vector<bool> >(bidirectional_iterator<const bool*>(a), bidirectional_iterator<const bool*>(an));
|
||||
test<std::vector<bool> >(random_access_iterator<const bool*>(a), random_access_iterator<const bool*>(an));
|
||||
test<std::vector<bool> >(a, an);
|
||||
#if TEST_STD_VER >= 11
|
||||
test<std::vector<bool, min_allocator<bool>> >(input_iterator<const bool*>(a), input_iterator<const bool*>(an));
|
||||
test<std::vector<bool, min_allocator<bool>> >(cpp17_input_iterator<const bool*>(a), cpp17_input_iterator<const bool*>(an));
|
||||
test<std::vector<bool, min_allocator<bool>> >(forward_iterator<const bool*>(a), forward_iterator<const bool*>(an));
|
||||
test<std::vector<bool, min_allocator<bool>> >(bidirectional_iterator<const bool*>(a), bidirectional_iterator<const bool*>(an));
|
||||
test<std::vector<bool, min_allocator<bool>> >(random_access_iterator<const bool*>(a), random_access_iterator<const bool*>(an));
|
||||
|
|
|
@ -37,7 +37,7 @@ int main(int, char**)
|
|||
bool* an = a + sizeof(a)/sizeof(a[0]);
|
||||
{
|
||||
std::allocator<bool> alloc;
|
||||
test<std::vector<bool> >(input_iterator<const bool*>(a), input_iterator<const bool*>(an), alloc);
|
||||
test<std::vector<bool> >(cpp17_input_iterator<const bool*>(a), cpp17_input_iterator<const bool*>(an), alloc);
|
||||
test<std::vector<bool> >(forward_iterator<const bool*>(a), forward_iterator<const bool*>(an), alloc);
|
||||
test<std::vector<bool> >(bidirectional_iterator<const bool*>(a), bidirectional_iterator<const bool*>(an), alloc);
|
||||
test<std::vector<bool> >(random_access_iterator<const bool*>(a), random_access_iterator<const bool*>(an), alloc);
|
||||
|
@ -46,7 +46,7 @@ int main(int, char**)
|
|||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
min_allocator<bool> alloc;
|
||||
test<std::vector<bool, min_allocator<bool>> >(input_iterator<const bool*>(a), input_iterator<const bool*>(an), alloc);
|
||||
test<std::vector<bool, min_allocator<bool>> >(cpp17_input_iterator<const bool*>(a), cpp17_input_iterator<const bool*>(an), alloc);
|
||||
test<std::vector<bool, min_allocator<bool>> >(forward_iterator<const bool*>(a), forward_iterator<const bool*>(an), alloc);
|
||||
test<std::vector<bool, min_allocator<bool>> >(bidirectional_iterator<const bool*>(a), bidirectional_iterator<const bool*>(an), alloc);
|
||||
test<std::vector<bool, min_allocator<bool>> >(random_access_iterator<const bool*>(a), random_access_iterator<const bool*>(an), alloc);
|
||||
|
|
|
@ -26,8 +26,8 @@ int main(int, char**)
|
|||
std::vector<bool> v(100);
|
||||
bool a[] = {1, 0, 0, 1, 1};
|
||||
const unsigned N = sizeof(a)/sizeof(a[0]);
|
||||
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, input_iterator<const bool*>(a),
|
||||
input_iterator<const bool*>(a+N));
|
||||
std::vector<bool>::iterator i = v.insert(v.cbegin() + 10, cpp17_input_iterator<const bool*>(a),
|
||||
cpp17_input_iterator<const bool*>(a+N));
|
||||
assert(v.size() == 100 + N);
|
||||
assert(i == v.begin() + 10);
|
||||
std::size_t j;
|
||||
|
@ -96,8 +96,8 @@ int main(int, char**)
|
|||
std::vector<bool, min_allocator<bool>> v(100);
|
||||
bool a[] = {1, 0, 0, 1, 1};
|
||||
const unsigned N = sizeof(a)/sizeof(a[0]);
|
||||
std::vector<bool, min_allocator<bool>>::iterator i = v.insert(v.cbegin() + 10, input_iterator<const bool*>(a),
|
||||
input_iterator<const bool*>(a+N));
|
||||
std::vector<bool, min_allocator<bool>>::iterator i = v.insert(v.cbegin() + 10, cpp17_input_iterator<const bool*>(a),
|
||||
cpp17_input_iterator<const bool*>(a+N));
|
||||
assert(v.size() == 100 + N);
|
||||
assert(i == v.begin() + 10);
|
||||
std::size_t j;
|
||||
|
|
|
@ -45,7 +45,7 @@ void test_emplaceable_concept() {
|
|||
}
|
||||
{
|
||||
using T = EmplaceConstructibleMoveableAndAssignable<int>;
|
||||
using It = input_iterator<int*>;
|
||||
using It = cpp17_input_iterator<int*>;
|
||||
{
|
||||
std::vector<T> v;
|
||||
v.assign(It(arr1), It(std::end(arr1)));
|
||||
|
|
|
@ -38,8 +38,8 @@ void test(Iterator first, Iterator last) {
|
|||
static void basic_test_cases() {
|
||||
int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0};
|
||||
int* an = a + sizeof(a) / sizeof(a[0]);
|
||||
test<std::vector<int> >(input_iterator<const int*>(a),
|
||||
input_iterator<const int*>(an));
|
||||
test<std::vector<int> >(cpp17_input_iterator<const int*>(a),
|
||||
cpp17_input_iterator<const int*>(an));
|
||||
test<std::vector<int> >(forward_iterator<const int*>(a),
|
||||
forward_iterator<const int*>(an));
|
||||
test<std::vector<int> >(bidirectional_iterator<const int*>(a),
|
||||
|
@ -49,7 +49,7 @@ static void basic_test_cases() {
|
|||
test<std::vector<int> >(a, an);
|
||||
|
||||
test<std::vector<int, limited_allocator<int, 63> > >(
|
||||
input_iterator<const int*>(a), input_iterator<const int*>(an));
|
||||
cpp17_input_iterator<const int*>(a), cpp17_input_iterator<const int*>(an));
|
||||
// Add 1 for implementations that dynamically allocate a container proxy.
|
||||
test<std::vector<int, limited_allocator<int, 18 + 1> > >(
|
||||
forward_iterator<const int*>(a), forward_iterator<const int*>(an));
|
||||
|
@ -61,8 +61,8 @@ static void basic_test_cases() {
|
|||
random_access_iterator<const int*>(an));
|
||||
test<std::vector<int, limited_allocator<int, 18 + 1> > >(a, an);
|
||||
#if TEST_STD_VER >= 11
|
||||
test<std::vector<int, min_allocator<int> > >(input_iterator<const int*>(a),
|
||||
input_iterator<const int*>(an));
|
||||
test<std::vector<int, min_allocator<int> > >(cpp17_input_iterator<const int*>(a),
|
||||
cpp17_input_iterator<const int*>(an));
|
||||
test<std::vector<int, min_allocator<int> > >(
|
||||
forward_iterator<const int*>(a), forward_iterator<const int*>(an));
|
||||
test<std::vector<int, min_allocator<int> > >(
|
||||
|
@ -95,7 +95,7 @@ void emplaceable_concept_tests() {
|
|||
}
|
||||
{
|
||||
using T = EmplaceConstructibleAndMoveInsertable<int>;
|
||||
using It = input_iterator<int*>;
|
||||
using It = cpp17_input_iterator<int*>;
|
||||
{
|
||||
std::vector<T> v(It(arr1), It(std::end(arr1)));
|
||||
assert(v[0].copied == 0);
|
||||
|
@ -132,7 +132,7 @@ void test_ctor_under_alloc() {
|
|||
}
|
||||
{
|
||||
using C = TCT::vector<>;
|
||||
using It = input_iterator<int*>;
|
||||
using It = cpp17_input_iterator<int*>;
|
||||
{
|
||||
ExpectConstructGuard<int&> G(1);
|
||||
C v(It(arr1), It(std::end(arr1)));
|
||||
|
|
|
@ -54,8 +54,8 @@ void basic_tests() {
|
|||
int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 1, 0};
|
||||
int* an = a + sizeof(a) / sizeof(a[0]);
|
||||
std::allocator<int> alloc;
|
||||
test<std::vector<int> >(input_iterator<const int*>(a),
|
||||
input_iterator<const int*>(an), alloc);
|
||||
test<std::vector<int> >(cpp17_input_iterator<const int*>(a),
|
||||
cpp17_input_iterator<const int*>(an), alloc);
|
||||
test<std::vector<int> >(forward_iterator<const int*>(a),
|
||||
forward_iterator<const int*>(an), alloc);
|
||||
test<std::vector<int> >(bidirectional_iterator<const int*>(a),
|
||||
|
@ -70,7 +70,7 @@ void basic_tests() {
|
|||
int* an = a + sizeof(a) / sizeof(a[0]);
|
||||
min_allocator<int> alloc;
|
||||
test<std::vector<int, min_allocator<int> > >(
|
||||
input_iterator<const int*>(a), input_iterator<const int*>(an), alloc);
|
||||
cpp17_input_iterator<const int*>(a), cpp17_input_iterator<const int*>(an), alloc);
|
||||
test<std::vector<int, min_allocator<int> > >(
|
||||
forward_iterator<const int*>(a), forward_iterator<const int*>(an),
|
||||
alloc);
|
||||
|
@ -108,7 +108,7 @@ void emplaceable_concept_tests() {
|
|||
}
|
||||
{
|
||||
using T = EmplaceConstructibleAndMoveInsertable<int>;
|
||||
using It = input_iterator<int*>;
|
||||
using It = cpp17_input_iterator<int*>;
|
||||
using Alloc = std::allocator<T>;
|
||||
Alloc a;
|
||||
{
|
||||
|
@ -147,7 +147,7 @@ void test_ctor_under_alloc() {
|
|||
}
|
||||
{
|
||||
using C = TCT::vector<>;
|
||||
using It = input_iterator<int*>;
|
||||
using It = cpp17_input_iterator<int*>;
|
||||
using Alloc = typename C::allocator_type;
|
||||
Alloc a;
|
||||
{
|
||||
|
|
|
@ -33,8 +33,8 @@ int main(int, char**)
|
|||
V v(100);
|
||||
int a[] = {1, 2, 3, 4, 5};
|
||||
const int N = sizeof(a)/sizeof(a[0]);
|
||||
V::iterator i = v.insert(v.cbegin() + 10, input_iterator<const int*>(a),
|
||||
input_iterator<const int*>(a+N));
|
||||
V::iterator i = v.insert(v.cbegin() + 10, cpp17_input_iterator<const int*>(a),
|
||||
cpp17_input_iterator<const int*>(a+N));
|
||||
assert(v.size() == 100 + N);
|
||||
assert(is_contiguous_container_asan_correct(v));
|
||||
assert(i == v.begin() + 10);
|
||||
|
@ -107,8 +107,8 @@ int main(int, char**)
|
|||
V v(100);
|
||||
int a[] = {1, 2, 3, 4, 5};
|
||||
const int N = sizeof(a)/sizeof(a[0]);
|
||||
V::iterator i = v.insert(v.cbegin() + 10, input_iterator<const int*>(a),
|
||||
input_iterator<const int*>(a+N));
|
||||
V::iterator i = v.insert(v.cbegin() + 10, cpp17_input_iterator<const int*>(a),
|
||||
cpp17_input_iterator<const int*>(a+N));
|
||||
assert(v.size() == 100 + N);
|
||||
assert(is_contiguous_container_asan_correct(v));
|
||||
assert(i == v.begin() + 10);
|
||||
|
@ -144,8 +144,8 @@ int main(int, char**)
|
|||
V v(100);
|
||||
int a[] = {1, 2, 3, 4, 5};
|
||||
const int N = sizeof(a)/sizeof(a[0]);
|
||||
V::iterator i = v.insert(v.cbegin() + 10, input_iterator<const int*>(a),
|
||||
input_iterator<const int*>(a+N));
|
||||
V::iterator i = v.insert(v.cbegin() + 10, cpp17_input_iterator<const int*>(a),
|
||||
cpp17_input_iterator<const int*>(a+N));
|
||||
assert(v.size() == 100 + N);
|
||||
assert(is_contiguous_container_asan_correct(v));
|
||||
assert(i == v.begin() + 10);
|
||||
|
@ -179,7 +179,7 @@ int main(int, char**)
|
|||
|
||||
{
|
||||
std::vector<adl::S> s;
|
||||
s.insert(s.end(), input_iterator<adl::S*>(), input_iterator<adl::S*>());
|
||||
s.insert(s.end(), cpp17_input_iterator<adl::S*>(), cpp17_input_iterator<adl::S*>());
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -48,7 +48,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(c.bucket_count() >= 5);
|
||||
assert(c.size() == 4);
|
||||
assert(c.at(1) == "one");
|
||||
|
@ -82,7 +82,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(c.bucket_count() >= 5);
|
||||
assert(c.size() == 4);
|
||||
assert(c.at(1) == "one");
|
||||
|
@ -116,7 +116,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(arr), input_iterator<P*>(arr + sizeof(arr)/sizeof(arr[0])), 14);
|
||||
C c(cpp17_input_iterator<P*>(arr), cpp17_input_iterator<P*>(arr + sizeof(arr)/sizeof(arr[0])), 14);
|
||||
assert(c.bucket_count() >= 14);
|
||||
assert(c.size() == 4);
|
||||
assert(c.at(1) == "one");
|
||||
|
@ -150,7 +150,7 @@ int main(int, char**)
|
|||
};
|
||||
HF hf(42);
|
||||
A a(43);
|
||||
C c(input_iterator<P*>(arr), input_iterator<P*>(arr + sizeof(arr)/sizeof(arr[0])), 14, hf, a);
|
||||
C c(cpp17_input_iterator<P*>(arr), cpp17_input_iterator<P*>(arr + sizeof(arr)/sizeof(arr[0])), 14, hf, a);
|
||||
assert(c.bucket_count() >= 14);
|
||||
assert(c.size() == 4);
|
||||
assert(c.at(1) == "one");
|
||||
|
|
|
@ -48,7 +48,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
10
|
||||
);
|
||||
LIBCPP_ASSERT(c.bucket_count() == 11);
|
||||
|
@ -84,7 +84,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
10
|
||||
);
|
||||
LIBCPP_ASSERT(c.bucket_count() == 11);
|
||||
|
|
|
@ -49,7 +49,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8)
|
||||
);
|
||||
|
@ -86,7 +86,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8)
|
||||
);
|
||||
|
|
|
@ -49,7 +49,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8),
|
||||
test_compare<std::equal_to<int> >(9)
|
||||
|
@ -87,7 +87,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8),
|
||||
test_compare<std::equal_to<int> >(9)
|
||||
|
|
|
@ -50,7 +50,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8),
|
||||
test_compare<std::equal_to<int> >(9),
|
||||
|
@ -89,7 +89,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8),
|
||||
test_compare<std::equal_to<int> >(9),
|
||||
|
@ -128,7 +128,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8),
|
||||
test_compare<std::equal_to<int> >(9),
|
||||
|
|
|
@ -38,7 +38,7 @@ int main(int, char**)
|
|||
P(2, "four"),
|
||||
};
|
||||
C c;
|
||||
c.insert(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
c.insert(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(c.size() == 4);
|
||||
assert(c.at(1) == "one");
|
||||
assert(c.at(2) == "two");
|
||||
|
@ -60,7 +60,7 @@ int main(int, char**)
|
|||
P(2, "four"),
|
||||
};
|
||||
C c;
|
||||
c.insert(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
c.insert(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(c.size() == 4);
|
||||
assert(c.at(1) == "one");
|
||||
assert(c.at(2) == "two");
|
||||
|
|
|
@ -50,7 +50,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(c.bucket_count() >= 7);
|
||||
assert(c.size() == 6);
|
||||
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
|
||||
|
@ -101,7 +101,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(c.bucket_count() >= 7);
|
||||
assert(c.size() == 6);
|
||||
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
|
||||
|
@ -153,7 +153,7 @@ int main(int, char**)
|
|||
P(2, "four"),
|
||||
};
|
||||
A a(42);
|
||||
C c(input_iterator<P*>(arr), input_iterator<P*>(arr + sizeof(arr)/sizeof(arr[0])), 14, a);
|
||||
C c(cpp17_input_iterator<P*>(arr), cpp17_input_iterator<P*>(arr + sizeof(arr)/sizeof(arr[0])), 14, a);
|
||||
assert(c.bucket_count() >= 14);
|
||||
assert(c.size() == 6);
|
||||
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
|
||||
|
@ -206,7 +206,7 @@ int main(int, char**)
|
|||
};
|
||||
A a(42);
|
||||
HF hf (43);
|
||||
C c(input_iterator<P*>(arr), input_iterator<P*>(arr + sizeof(arr)/sizeof(arr[0])), 12, hf, a );
|
||||
C c(cpp17_input_iterator<P*>(arr), cpp17_input_iterator<P*>(arr + sizeof(arr)/sizeof(arr[0])), 12, hf, a );
|
||||
assert(c.bucket_count() >= 12);
|
||||
assert(c.size() == 6);
|
||||
typedef std::pair<C::const_iterator, C::const_iterator> Eq;
|
||||
|
|
|
@ -50,7 +50,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
10
|
||||
);
|
||||
LIBCPP_ASSERT(c.bucket_count() == 11);
|
||||
|
@ -103,7 +103,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
10
|
||||
);
|
||||
LIBCPP_ASSERT(c.bucket_count() == 11);
|
||||
|
|
|
@ -51,7 +51,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8)
|
||||
);
|
||||
|
@ -105,7 +105,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8)
|
||||
);
|
||||
|
|
|
@ -51,7 +51,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8),
|
||||
test_compare<std::equal_to<int> >(9)
|
||||
|
@ -106,7 +106,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8),
|
||||
test_compare<std::equal_to<int> >(9)
|
||||
|
|
|
@ -52,7 +52,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8),
|
||||
test_compare<std::equal_to<int> >(9),
|
||||
|
@ -108,7 +108,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8),
|
||||
test_compare<std::equal_to<int> >(9),
|
||||
|
@ -164,7 +164,7 @@ int main(int, char**)
|
|||
P(1, "four"),
|
||||
P(2, "four"),
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8),
|
||||
test_compare<std::equal_to<int> >(9),
|
||||
|
|
|
@ -41,7 +41,7 @@ int main(int, char**)
|
|||
P(2, "four"),
|
||||
};
|
||||
C c;
|
||||
c.insert(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
c.insert(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(c.size() == 6);
|
||||
typedef std::pair<C::iterator, C::iterator> Eq;
|
||||
Eq eq = c.equal_range(1);
|
||||
|
@ -83,7 +83,7 @@ int main(int, char**)
|
|||
P(2, "four"),
|
||||
};
|
||||
C c;
|
||||
c.insert(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
c.insert(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(c.size() == 6);
|
||||
typedef std::pair<C::iterator, C::iterator> Eq;
|
||||
Eq eq = c.equal_range(1);
|
||||
|
|
|
@ -37,7 +37,7 @@ int main(int, char**)
|
|||
P(2)
|
||||
};
|
||||
C c;
|
||||
c.insert(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
c.insert(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(c.size() == 6);
|
||||
assert(c.count(1) == 2);
|
||||
assert(c.count(2) == 2);
|
||||
|
@ -59,7 +59,7 @@ int main(int, char**)
|
|||
P(2)
|
||||
};
|
||||
C c;
|
||||
c.insert(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
c.insert(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(c.size() == 6);
|
||||
assert(c.count(1) == 2);
|
||||
assert(c.count(2) == 2);
|
||||
|
|
|
@ -46,7 +46,7 @@ int main(int, char**)
|
|||
P(1),
|
||||
P(2)
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(c.bucket_count() >= 7);
|
||||
assert(c.size() == 6);
|
||||
assert(c.count(1) == 2);
|
||||
|
@ -79,7 +79,7 @@ int main(int, char**)
|
|||
P(1),
|
||||
P(2)
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(c.bucket_count() >= 7);
|
||||
assert(c.size() == 6);
|
||||
assert(c.count(1) == 2);
|
||||
|
@ -112,7 +112,7 @@ int main(int, char**)
|
|||
T(2)
|
||||
};
|
||||
A a(42);
|
||||
C c(input_iterator<T*>(arr), input_iterator<T*>(arr + sizeof(arr)/sizeof(arr[0])), 12, a);
|
||||
C c(cpp17_input_iterator<T*>(arr), cpp17_input_iterator<T*>(arr + sizeof(arr)/sizeof(arr[0])), 12, a);
|
||||
assert(c.bucket_count() >= 12);
|
||||
assert(c.size() == 6);
|
||||
assert(c.count(1) == 2);
|
||||
|
@ -146,7 +146,7 @@ int main(int, char**)
|
|||
};
|
||||
HF hf(43);
|
||||
A a(42);
|
||||
C c(input_iterator<T*>(arr), input_iterator<T*>(arr + sizeof(arr)/sizeof(arr[0])), 16, hf, a);
|
||||
C c(cpp17_input_iterator<T*>(arr), cpp17_input_iterator<T*>(arr + sizeof(arr)/sizeof(arr[0])), 16, hf, a);
|
||||
assert(c.bucket_count() >= 16);
|
||||
assert(c.size() == 6);
|
||||
assert(c.count(1) == 2);
|
||||
|
|
|
@ -46,7 +46,7 @@ int main(int, char**)
|
|||
P(1),
|
||||
P(2)
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7
|
||||
);
|
||||
LIBCPP_ASSERT(c.bucket_count() == 7);
|
||||
|
@ -81,7 +81,7 @@ int main(int, char**)
|
|||
P(1),
|
||||
P(2)
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7
|
||||
);
|
||||
LIBCPP_ASSERT(c.bucket_count() == 7);
|
||||
|
|
|
@ -47,7 +47,7 @@ int main(int, char**)
|
|||
P(1),
|
||||
P(2)
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8)
|
||||
);
|
||||
|
@ -83,7 +83,7 @@ int main(int, char**)
|
|||
P(1),
|
||||
P(2)
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8)
|
||||
);
|
||||
|
|
|
@ -47,7 +47,7 @@ int main(int, char**)
|
|||
P(1),
|
||||
P(2)
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8),
|
||||
test_compare<std::equal_to<int> >(9)
|
||||
|
@ -84,7 +84,7 @@ int main(int, char**)
|
|||
P(1),
|
||||
P(2)
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8),
|
||||
test_compare<std::equal_to<int> >(9)
|
||||
|
|
|
@ -48,7 +48,7 @@ int main(int, char**)
|
|||
P(1),
|
||||
P(2)
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8),
|
||||
test_compare<std::equal_to<int> >(9),
|
||||
|
@ -86,7 +86,7 @@ int main(int, char**)
|
|||
P(1),
|
||||
P(2)
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])),
|
||||
7,
|
||||
test_hash<std::hash<int> >(8),
|
||||
test_compare<std::equal_to<int> >(9),
|
||||
|
|
|
@ -37,7 +37,7 @@ int main(int, char**)
|
|||
P(2)
|
||||
};
|
||||
C c;
|
||||
c.insert(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
c.insert(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(c.size() == 4);
|
||||
assert(c.count(1) == 1);
|
||||
assert(c.count(2) == 1);
|
||||
|
@ -59,7 +59,7 @@ int main(int, char**)
|
|||
P(2)
|
||||
};
|
||||
C c;
|
||||
c.insert(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
c.insert(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(c.size() == 4);
|
||||
assert(c.count(1) == 1);
|
||||
assert(c.count(2) == 1);
|
||||
|
|
|
@ -46,7 +46,7 @@ int main(int, char**)
|
|||
P(1),
|
||||
P(2)
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(c.bucket_count() >= 5);
|
||||
assert(c.size() == 4);
|
||||
assert(c.count(1) == 1);
|
||||
|
@ -79,7 +79,7 @@ int main(int, char**)
|
|||
P(1),
|
||||
P(2)
|
||||
};
|
||||
C c(input_iterator<P*>(a), input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
C c(cpp17_input_iterator<P*>(a), cpp17_input_iterator<P*>(a + sizeof(a)/sizeof(a[0])));
|
||||
assert(c.bucket_count() >= 5);
|
||||
assert(c.size() == 4);
|
||||
assert(c.count(1) == 1);
|
||||
|
@ -112,7 +112,7 @@ int main(int, char**)
|
|||
T(2)
|
||||
};
|
||||
A a(42);
|
||||
C c(input_iterator<T*>(arr), input_iterator<T*>(arr + sizeof(arr)/sizeof(arr[0])), 12, a);
|
||||
C c(cpp17_input_iterator<T*>(arr), cpp17_input_iterator<T*>(arr + sizeof(arr)/sizeof(arr[0])), 12, a);
|
||||
assert(c.bucket_count() >= 12);
|
||||
assert(c.size() == 4);
|
||||
assert(c.count(1) == 1);
|
||||
|
@ -146,7 +146,7 @@ int main(int, char**)
|
|||
};
|
||||
HF hf(43);
|
||||
A a(42);
|
||||
C c(input_iterator<T*>(arr), input_iterator<T*>(arr + sizeof(arr)/sizeof(arr[0])), 16, hf, a);
|
||||
C c(cpp17_input_iterator<T*>(arr), cpp17_input_iterator<T*>(arr + sizeof(arr)/sizeof(arr[0])), 16, hf, a);
|
||||
assert(c.bucket_count() >= 16);
|
||||
assert(c.size() == 4);
|
||||
assert(c.count(1) == 1);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue