Implement n3607: 'equal', 'mismatch', and 'is_permutation'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@181548 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -19,6 +19,10 @@
|
||||
|
||||
#include "test_iterators.h"
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
#define HAS_FOUR_ITERATOR_VERSION
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
@@ -28,9 +32,25 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + 0),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + 0),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + 0)) == true);
|
||||
#endif
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0};
|
||||
@@ -39,6 +59,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
@@ -48,6 +74,16 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0};
|
||||
@@ -56,6 +92,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0};
|
||||
@@ -64,6 +106,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0};
|
||||
@@ -72,6 +120,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1};
|
||||
@@ -80,6 +134,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1};
|
||||
@@ -88,6 +148,16 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1};
|
||||
@@ -96,6 +166,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == true);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1};
|
||||
@@ -104,6 +180,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 0};
|
||||
@@ -112,6 +194,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 0};
|
||||
@@ -120,6 +208,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == true);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 0};
|
||||
@@ -128,6 +222,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == true);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 0};
|
||||
@@ -136,6 +236,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 1};
|
||||
@@ -144,6 +250,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 1};
|
||||
@@ -152,6 +264,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 1};
|
||||
@@ -160,6 +278,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 1};
|
||||
@@ -168,6 +292,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == true);
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
@@ -177,6 +307,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 0};
|
||||
@@ -185,6 +321,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 0};
|
||||
@@ -193,6 +335,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 0};
|
||||
@@ -201,6 +349,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 0};
|
||||
@@ -209,6 +363,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 0};
|
||||
@@ -217,6 +377,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 0};
|
||||
@@ -225,6 +391,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 0};
|
||||
@@ -233,6 +405,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 0};
|
||||
@@ -241,6 +419,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 1};
|
||||
@@ -249,6 +433,16 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 1};
|
||||
@@ -257,6 +451,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1, 2};
|
||||
@@ -265,6 +465,16 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1, 2};
|
||||
@@ -273,6 +483,16 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1, 2};
|
||||
@@ -281,6 +501,16 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1, 2};
|
||||
@@ -289,6 +519,16 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 1};
|
||||
@@ -297,6 +537,12 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 1};
|
||||
@@ -305,6 +551,20 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib + 1),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1, 2, 3, 0, 5, 6, 2, 4, 4};
|
||||
@@ -313,6 +573,20 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib + 1 ),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1)) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1, 2, 3, 0, 5, 6, 2, 4, 4};
|
||||
@@ -321,5 +595,11 @@ int main()
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib)) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa)) == false);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@@ -20,6 +20,18 @@
|
||||
|
||||
#include "test_iterators.h"
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
#define HAS_FOUR_ITERATOR_VERSION
|
||||
#endif
|
||||
|
||||
int comparison_count = 0;
|
||||
template <typename T>
|
||||
bool counting_equals ( const T &a, const T &b ) {
|
||||
++comparison_count;
|
||||
return a == b;
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
@@ -34,6 +46,18 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0};
|
||||
@@ -43,6 +67,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
@@ -53,6 +84,18 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0};
|
||||
@@ -62,6 +105,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0};
|
||||
@@ -71,6 +121,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0};
|
||||
@@ -80,6 +137,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1};
|
||||
@@ -89,6 +153,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1};
|
||||
@@ -98,6 +169,18 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1};
|
||||
@@ -107,6 +190,18 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1};
|
||||
@@ -116,6 +211,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 0};
|
||||
@@ -125,6 +227,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 0};
|
||||
@@ -134,6 +243,18 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 0};
|
||||
@@ -143,6 +264,18 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 0};
|
||||
@@ -152,6 +285,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 1};
|
||||
@@ -161,6 +301,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 1};
|
||||
@@ -170,6 +317,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 1};
|
||||
@@ -179,6 +333,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {1, 1};
|
||||
@@ -188,6 +349,18 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
@@ -198,6 +371,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 0};
|
||||
@@ -207,6 +387,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 0};
|
||||
@@ -216,6 +403,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 0};
|
||||
@@ -225,6 +419,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 0};
|
||||
@@ -234,6 +435,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 0};
|
||||
@@ -243,6 +451,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 0};
|
||||
@@ -252,6 +467,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 0};
|
||||
@@ -261,6 +483,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 0};
|
||||
@@ -270,6 +499,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 1};
|
||||
@@ -279,6 +515,18 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 1};
|
||||
@@ -288,6 +536,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1, 2};
|
||||
@@ -297,6 +552,18 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1, 2};
|
||||
@@ -306,6 +573,18 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1, 2};
|
||||
@@ -315,6 +594,18 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1, 2};
|
||||
@@ -324,6 +615,18 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 1};
|
||||
@@ -333,6 +636,13 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 0, 1};
|
||||
@@ -342,6 +652,23 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib + 1),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1, 2, 3, 0, 5, 6, 2, 4, 4};
|
||||
@@ -351,6 +678,37 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == true);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == true);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib + 1),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1),
|
||||
std::equal_to<const int>()) == false);
|
||||
comparison_count = 0;
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa - 1),
|
||||
counting_equals<const int>) == false);
|
||||
assert ( comparison_count > 0 );
|
||||
comparison_count = 0;
|
||||
assert(std::is_permutation(random_access_iterator<const int*>(ia),
|
||||
random_access_iterator<const int*>(ia + sa),
|
||||
random_access_iterator<const int*>(ib),
|
||||
random_access_iterator<const int*>(ib + sa - 1),
|
||||
counting_equals<const int>) == false);
|
||||
assert ( comparison_count == 0 );
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const int ia[] = {0, 1, 2, 3, 0, 5, 6, 2, 4, 4};
|
||||
@@ -360,5 +718,12 @@ int main()
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
std::equal_to<const int>()) == false);
|
||||
#ifdef HAS_FOUR_ITERATOR_VERSION
|
||||
assert(std::is_permutation(forward_iterator<const int*>(ia),
|
||||
forward_iterator<const int*>(ia + sa),
|
||||
forward_iterator<const int*>(ib),
|
||||
forward_iterator<const int*>(ib + sa),
|
||||
std::equal_to<const int>()) == false);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user