Revert "Merge to upstream r304942."
This reverts commit83b1388ecd, reversing changes made tof20819f925. Test: treehugger Bug: None
This commit is contained in:
@@ -20,22 +20,16 @@
|
||||
|
||||
#include "test_iterators.h"
|
||||
|
||||
struct eq {
|
||||
eq (int val) : v(val) {}
|
||||
bool operator () (int v2) const { return v == v2; }
|
||||
int v;
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
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),
|
||||
eq(3));
|
||||
std::bind2nd(std::equal_to<int>(), 3));
|
||||
assert(*r == 3);
|
||||
r = std::find_if(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
eq(10));
|
||||
std::bind2nd(std::equal_to<int>(), 10));
|
||||
assert(r == input_iterator<const int*>(ia+s));
|
||||
}
|
||||
|
||||
@@ -20,23 +20,16 @@
|
||||
|
||||
#include "test_iterators.h"
|
||||
|
||||
struct ne {
|
||||
ne (int val) : v(val) {}
|
||||
bool operator () (int v2) const { return v != v2; }
|
||||
int v;
|
||||
};
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
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),
|
||||
ne(3));
|
||||
std::bind2nd(std::not_equal_to<int>(), 3));
|
||||
assert(*r == 3);
|
||||
r = std::find_if_not(input_iterator<const int*>(ia),
|
||||
input_iterator<const int*>(ia+s),
|
||||
ne(10));
|
||||
std::bind2nd(std::not_equal_to<int>(), 10));
|
||||
assert(r == input_iterator<const int*>(ia+s));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user