Purge all usages of _LIBCPP_STD_VER under test/std/algorithm

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283643 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier 2016-10-08 01:25:23 +00:00
parent daa895f887
commit fd1c9dddcc
17 changed files with 132 additions and 121 deletions

View File

@ -17,11 +17,9 @@
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
#if _LIBCPP_STD_VER > 11
#define HAS_FOUR_ITERATOR_VERSION
#endif
int main()
{
@ -31,7 +29,7 @@ int main()
assert(std::equal(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
input_iterator<const int*>(ia)));
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::equal(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
input_iterator<const int*>(ia),
@ -44,7 +42,7 @@ int main()
assert(!std::equal(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
input_iterator<const int*>(ib)));
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(!std::equal(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
input_iterator<const int*>(ib),

View File

@ -19,12 +19,9 @@
#include <functional>
#include <cassert>
#include "test_macros.h"
#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 ) {
@ -41,7 +38,7 @@ int main()
input_iterator<const int*>(ia+s),
input_iterator<const int*>(ia),
std::equal_to<int>()));
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::equal(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
input_iterator<const int*>(ia),
@ -72,7 +69,7 @@ int main()
input_iterator<const int*>(ia+s),
input_iterator<const int*>(ib),
std::equal_to<int>()));
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(!std::equal(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
input_iterator<const int*>(ib),

View File

@ -19,9 +19,7 @@
#include "test_iterators.h"
#if _LIBCPP_STD_VER > 11
#define HAS_FOUR_ITERATOR_VERSION
#endif
#include "test_macros.h"
int main()
{
@ -32,7 +30,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + 0),
forward_iterator<const int*>(ib),
@ -41,7 +39,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -59,7 +57,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -74,7 +72,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -92,7 +90,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -106,7 +104,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -120,7 +118,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -134,7 +132,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -148,7 +146,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -166,7 +164,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -180,7 +178,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -194,7 +192,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -208,7 +206,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -222,7 +220,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -236,7 +234,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -250,7 +248,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -264,7 +262,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -278,7 +276,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -292,7 +290,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -307,7 +305,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -321,7 +319,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -335,7 +333,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -349,7 +347,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -363,7 +361,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -377,7 +375,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -391,7 +389,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -405,7 +403,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -419,7 +417,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -433,7 +431,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -451,7 +449,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -465,7 +463,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -483,7 +481,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -501,7 +499,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -519,7 +517,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -537,7 +535,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -551,7 +549,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -573,7 +571,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -595,7 +593,7 @@ 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
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),

View File

@ -18,12 +18,9 @@
#include <functional>
#include <cassert>
#include "test_macros.h"
#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 ) {
@ -46,7 +43,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -67,7 +64,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -84,7 +81,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -105,7 +102,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -121,7 +118,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -137,7 +134,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -153,7 +150,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -169,7 +166,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -190,7 +187,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -211,7 +208,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -227,7 +224,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -243,7 +240,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -264,7 +261,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -285,7 +282,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -301,7 +298,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -317,7 +314,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -333,7 +330,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -349,7 +346,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -371,7 +368,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -387,7 +384,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -403,7 +400,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -419,7 +416,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -435,7 +432,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -451,7 +448,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -467,7 +464,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -483,7 +480,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -499,7 +496,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -515,7 +512,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -536,7 +533,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -552,7 +549,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -573,7 +570,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -594,7 +591,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -615,7 +612,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -636,7 +633,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -652,7 +649,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -678,7 +675,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == true);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
@ -718,7 +715,7 @@ int main()
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),
std::equal_to<const int>()) == false);
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::is_permutation(forward_iterator<const int*>(ia),
forward_iterator<const int*>(ia + sa),
forward_iterator<const int*>(ib),

View File

@ -49,7 +49,7 @@ int main()
assert(bcp.count() > 0 && bcp.count() < sa);
bcp.reset();
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::mismatch(II(ia), II(ia + sa), II(ib), II(ib + sb), EQ())
== (std::pair<II, II>(II(ia+3), II(ib+3))));
assert(std::mismatch(RAI(ia), RAI(ia + sa), RAI(ib), RAI(ib + sb), EQ())
@ -63,7 +63,7 @@ int main()
assert(std::mismatch(ia, ia + sa, ib, EQ()) ==
(std::pair<int*,int*>(ia+3,ib+3)));
#ifdef HAS_FOUR_ITERATOR_VERSION
#if TEST_STD_VER >= 14
assert(std::mismatch(ia, ia + sa, ib, ib + sb, EQ()) ==
(std::pair<int*,int*>(ia+3,ib+3)));
assert(std::mismatch(ia, ia + sa, ib, ib + 2, EQ()) ==

View File

@ -16,6 +16,8 @@
#include <algorithm>
#include <cassert>
#include "test_macros.h"
template <class T>
void
test(const T& a, const T& b, const T& x)
@ -43,7 +45,7 @@ int main()
test(x, y, x);
test(y, x, x);
}
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER >= 14
{
constexpr int x = 1;
constexpr int y = 0;

View File

@ -18,6 +18,8 @@
#include <functional>
#include <cassert>
#include "test_macros.h"
template <class T, class C>
void
test(const T& a, const T& b, C c, const T& x)
@ -45,7 +47,7 @@ int main()
test(x, y, std::greater<int>(), y);
test(y, x, std::greater<int>(), y);
}
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER >= 14
{
constexpr int x = 1;
constexpr int y = 0;

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <algorithm>
// template <class T>
@ -16,9 +18,10 @@
#include <algorithm>
#include <cassert>
#include "test_macros.h"
int main()
{
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
int i = std::max({2, 3, 1});
assert(i == 3);
i = std::max({2, 1, 3});
@ -31,12 +34,11 @@ int main()
assert(i == 3);
i = std::max({1, 3, 2});
assert(i == 3);
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER >= 14
{
static_assert(std::max({1, 3, 2}) == 3, "");
static_assert(std::max({2, 1, 3}) == 3, "");
static_assert(std::max({3, 2, 1}) == 3, "");
}
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <algorithm>
// template<class T, class Compare>
@ -17,9 +19,10 @@
#include <functional>
#include <cassert>
#include "test_macros.h"
int main()
{
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
int i = std::max({2, 3, 1}, std::greater<int>());
assert(i == 1);
i = std::max({2, 1, 3}, std::greater<int>());
@ -32,12 +35,11 @@ int main()
assert(i == 1);
i = std::max({1, 3, 2}, std::greater<int>());
assert(i == 1);
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER >= 14
{
static_assert(std::max({1, 3, 2}, std::greater<int>()) == 1, "");
static_assert(std::max({2, 1, 3}, std::greater<int>()) == 1, "");
static_assert(std::max({3, 2, 1}, std::greater<int>()) == 1, "");
}
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}

View File

@ -16,6 +16,8 @@
#include <algorithm>
#include <cassert>
#include "test_macros.h"
template <class T>
void
test(const T& a, const T& b, const T& x)
@ -43,7 +45,7 @@ int main()
test(x, y, y);
test(y, x, y);
}
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER >= 14
{
constexpr int x = 1;
constexpr int y = 0;

View File

@ -18,6 +18,8 @@
#include <functional>
#include <cassert>
#include "test_macros.h"
template <class T, class C>
void
test(const T& a, const T& b, C c, const T& x)
@ -45,7 +47,7 @@ int main()
test(x, y, std::greater<int>(), x);
test(y, x, std::greater<int>(), x);
}
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER >= 14
{
constexpr int x = 1;
constexpr int y = 0;

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <algorithm>
// template<class T>
@ -16,9 +18,10 @@
#include <algorithm>
#include <cassert>
#include "test_macros.h"
int main()
{
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
int i = std::min({2, 3, 1});
assert(i == 1);
i = std::min({2, 1, 3});
@ -31,12 +34,11 @@ int main()
assert(i == 1);
i = std::min({1, 3, 2});
assert(i == 1);
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER >= 14
{
static_assert(std::min({1, 3, 2}) == 1, "");
static_assert(std::min({2, 1, 3}) == 1, "");
static_assert(std::min({3, 2, 1}) == 1, "");
}
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <algorithm>
// template<class T, class Compare>
@ -17,9 +19,10 @@
#include <functional>
#include <cassert>
#include "test_macros.h"
int main()
{
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
int i = std::min({2, 3, 1}, std::greater<int>());
assert(i == 3);
i = std::min({2, 1, 3}, std::greater<int>());
@ -32,12 +35,11 @@ int main()
assert(i == 3);
i = std::min({1, 3, 2}, std::greater<int>());
assert(i == 3);
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER >= 14
{
static_assert(std::min({1, 3, 2}, std::greater<int>()) == 3, "");
static_assert(std::min({2, 1, 3}, std::greater<int>()) == 3, "");
static_assert(std::min({3, 2, 1}, std::greater<int>()) == 3, "");
}
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}

View File

@ -16,6 +16,8 @@
#include <algorithm>
#include <cassert>
#include "test_macros.h"
template <class T>
void
test(const T& a, const T& b, const T& x, const T& y)
@ -45,7 +47,7 @@ int main()
test(x, y, y, x);
test(y, x, y, x);
}
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER >= 14
{
// Note that you can't take a reference to a local var, since
// its address is not a compile-time constant.

View File

@ -18,6 +18,8 @@
#include <functional>
#include <cassert>
#include "test_macros.h"
template <class T, class C>
void
test(const T& a, const T& b, C c, const T& x, const T& y)
@ -48,7 +50,7 @@ int main()
test(x, y, std::greater<int>(), x, y);
test(y, x, std::greater<int>(), x, y);
}
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER >= 14
{
// Note that you can't take a reference to a local var, since
// its address is not a compile-time constant.

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <algorithm>
// template<class T>
@ -16,16 +18,17 @@
#include <algorithm>
#include <cassert>
#include "test_macros.h"
int main()
{
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
assert((std::minmax({1, 2, 3}) == std::pair<int, int>(1, 3)));
assert((std::minmax({1, 3, 2}) == std::pair<int, int>(1, 3)));
assert((std::minmax({2, 1, 3}) == std::pair<int, int>(1, 3)));
assert((std::minmax({2, 3, 1}) == std::pair<int, int>(1, 3)));
assert((std::minmax({3, 1, 2}) == std::pair<int, int>(1, 3)));
assert((std::minmax({3, 2, 1}) == std::pair<int, int>(1, 3)));
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER >= 14
{
static_assert((std::minmax({1, 2, 3}) == std::pair<int, int>(1, 3)), "");
static_assert((std::minmax({1, 3, 2}) == std::pair<int, int>(1, 3)), "");
@ -35,5 +38,4 @@ int main()
static_assert((std::minmax({3, 2, 1}) == std::pair<int, int>(1, 3)), "");
}
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}

View File

@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03
// <algorithm>
// template<class T, class Compare>
@ -19,11 +21,11 @@
#include <functional>
#include <cassert>
#include "test_macros.h"
#include "counting_predicates.hpp"
bool all_equal(int, int) { return false; } // everything is equal
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
void test_all_equal(std::initializer_list<int> il)
{
binary_counting_predicate<bool(*)(int, int), int, int> pred (all_equal);
@ -33,11 +35,9 @@ void test_all_equal(std::initializer_list<int> il)
assert(p.second == *--ptr);
assert(pred.count() <= ((3 * il.size()) / 2));
}
#endif
int main()
{
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
assert((std::minmax({1, 2, 3}, std::greater<int>()) == std::pair<int, int>(3, 1)));
assert((std::minmax({1, 3, 2}, std::greater<int>()) == std::pair<int, int>(3, 1)));
assert((std::minmax({2, 1, 3}, std::greater<int>()) == std::pair<int, int>(3, 1)));
@ -63,7 +63,7 @@ int main()
test_all_equal({0,1,2,3,4,5,6,7,8,9,10});
test_all_equal({0,1,2,3,4,5,6,7,8,9,10,11});
#if _LIBCPP_STD_VER > 11
#if TEST_STD_VER >= 14
{
static_assert((std::minmax({1, 2, 3}, std::greater<int>()) == std::pair<int, int>(3, 1)), "");
static_assert((std::minmax({1, 3, 2}, std::greater<int>()) == std::pair<int, int>(3, 1)), "");
@ -73,5 +73,4 @@ int main()
static_assert((std::minmax({3, 2, 1}, std::greater<int>()) == std::pair<int, int>(3, 1)), "");
}
#endif
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}