aboutsummaryrefslogtreecommitdiff
path: root/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-16 16:03:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-16 16:03:23 +0000
commit0dc0969cd0a732760f0aa79942a04e0eaef297c4 (patch)
tree051bdb57b1ac6ee143f61ddbb47bd0da619f6f0c /test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp
parent868847c6900e575417c03bced6e562b3af891318 (diff)
Notes
Diffstat (limited to 'test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp')
-rw-r--r--test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp
index bde6ff389d0c..c942d2e38a58 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp
@@ -20,16 +20,22 @@
#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),
- std::bind2nd(std::equal_to<int>(), 3));
+ eq(3));
assert(*r == 3);
r = std::find_if(input_iterator<const int*>(ia),
input_iterator<const int*>(ia+s),
- std::bind2nd(std::equal_to<int>(), 10));
+ eq(10));
assert(r == input_iterator<const int*>(ia+s));
}