summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2017-03-23 16:13:50 +0000
committerMarshall Clow <mclow.lists@gmail.com>2017-03-23 16:13:50 +0000
commit315cd1fec9864bf974545a0860f50b8788f72c86 (patch)
tree9a5b2aec673430b11201669435d97b252b1fcc6f /libcxx/test/std/algorithms/alg.modifying.operations/alg.replace
parentc3e9c1442da3f1e68b9b894c50d219747991330a (diff)
downloadbcm5719-llvm-315cd1fec9864bf974545a0860f50b8788f72c86.tar.gz
bcm5719-llvm-315cd1fec9864bf974545a0860f50b8788f72c86.zip
Update the algorithm tests to not use the (deprecated) function binders. No functional change.
llvm-svn: 298618
Diffstat (limited to 'libcxx/test/std/algorithms/alg.modifying.operations/alg.replace')
-rw-r--r--libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp6
-rw-r--r--libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp4
2 files changed, 7 insertions, 3 deletions
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp
index 1eff3d39e20..f2ffece12e8 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp
@@ -23,6 +23,8 @@
#include "test_iterators.h"
+bool equalToTwo(int v) { return v == 2; }
+
template <class InIter, class OutIter>
void
test()
@@ -30,8 +32,8 @@ test()
int ia[] = {0, 1, 2, 3, 4};
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
int ib[sa] = {0};
- OutIter r = std::replace_copy_if(InIter(ia), InIter(ia+sa), OutIter(ib),
- std::bind2nd(std::equal_to<int>(), 2), 5);
+ OutIter r = std::replace_copy_if(InIter(ia), InIter(ia+sa),
+ OutIter(ib), equalToTwo, 5);
assert(base(r) == ib + sa);
assert(ib[0] == 0);
assert(ib[1] == 1);
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp
index 8d6ab04e14d..ebb2945d7c4 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp
@@ -22,13 +22,15 @@
#include "test_iterators.h"
+bool equalToTwo(int v) { return v == 2; }
+
template <class Iter>
void
test()
{
int ia[] = {0, 1, 2, 3, 4};
const unsigned sa = sizeof(ia)/sizeof(ia[0]);
- std::replace_if(Iter(ia), Iter(ia+sa), std::bind2nd(std::equal_to<int>(), 2), 5);
+ std::replace_if(Iter(ia), Iter(ia+sa), equalToTwo, 5);
assert(ia[0] == 0);
assert(ia[1] == 1);
assert(ia[2] == 5);
OpenPOWER on IntegriCloud