Revert "Merge to upstream r304942."

This reverts commit 83b1388ecd, reversing
changes made to f20819f925.

Test: treehugger
Bug: None
This commit is contained in:
Dan Albert
2018-01-11 10:41:39 -08:00
parent ef7d5b4347
commit 38a0d5af7e
1110 changed files with 15077 additions and 19371 deletions

View File

@@ -17,9 +17,10 @@
#include <algorithm>
#include <cassert>
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
#endif
#include "test_macros.h"
#include "test_iterators.h"
template <class Iter>
@@ -38,7 +39,8 @@ test()
assert(ia[5] == 4);
}
#if TEST_STD_VER >= 11
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class Iter>
void
test1()
@@ -60,7 +62,8 @@ test1()
assert(*ia[4] == 3);
assert(*ia[5] == 4);
}
#endif // TEST_STD_VER >= 11
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
int main()
{
@@ -69,10 +72,12 @@ int main()
test<random_access_iterator<int*> >();
test<int*>();
#if TEST_STD_VER >= 11
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
test1<forward_iterator<std::unique_ptr<int>*> >();
test1<bidirectional_iterator<std::unique_ptr<int>*> >();
test1<random_access_iterator<std::unique_ptr<int>*> >();
test1<std::unique_ptr<int>*>();
#endif // TEST_STD_VER >= 11
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}

View File

@@ -21,8 +21,6 @@
#include "test_iterators.h"
bool equalToTwo(int v) { return v == 2; }
template <class InIter, class OutIter>
void
test()
@@ -30,8 +28,8 @@ test()
int ia[] = {0, 1, 2, 3, 4, 2, 3, 4, 2};
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
int ib[sa];
OutIter r = std::remove_copy_if(InIter(ia), InIter(ia+sa),
OutIter(ib), equalToTwo);
OutIter r = std::remove_copy_if(InIter(ia), InIter(ia+sa), OutIter(ib),
std::bind2nd(std::equal_to<int>(), 2));
assert(base(r) == ib + sa-3);
assert(ib[0] == 0);
assert(ib[1] == 1);

View File

@@ -18,9 +18,10 @@
#include <algorithm>
#include <functional>
#include <cassert>
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
#endif
#include "test_macros.h"
#include "test_iterators.h"
#include "counting_predicates.hpp"
@@ -45,7 +46,8 @@ test()
assert(cp.count() == sa);
}
#if TEST_STD_VER >= 11
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
struct pred
{
bool operator()(const std::unique_ptr<int>& i) {return *i == 2;}
@@ -75,7 +77,8 @@ test1()
assert(*ia[4] == 3);
assert(*ia[5] == 4);
}
#endif // TEST_STD_VER >= 11
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
int main()
{
@@ -84,10 +87,12 @@ int main()
test<random_access_iterator<int*> >();
test<int*>();
#if TEST_STD_VER >= 11
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
test1<forward_iterator<std::unique_ptr<int>*> >();
test1<bidirectional_iterator<std::unique_ptr<int>*> >();
test1<random_access_iterator<std::unique_ptr<int>*> >();
test1<std::unique_ptr<int>*>();
#endif // TEST_STD_VER >= 11
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}