From 28cc4dde490655c2bc88d0328c73ed33615cc2a8 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Tue, 8 Mar 2016 15:12:52 +0000 Subject: Implement P0253R1: Fixing a design mistake in the searchers interface. llvm-svn: 262928 --- libcxx/test/std/experimental/algorithms/alg.search/search.pass.cpp | 7 ++++--- .../func.searchers/func.searchers.boyer_moore/default.pass.cpp | 2 +- .../func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp | 2 +- .../func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp | 2 +- .../func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp | 2 +- .../func.searchers.boyer_moore_horspool/default.pass.cpp | 2 +- .../func.searchers.boyer_moore_horspool/hash.pass.cpp | 2 +- .../func.searchers.boyer_moore_horspool/hash.pred.pass.cpp | 2 +- .../func.searchers.boyer_moore_horspool/pred.pass.cpp | 2 +- .../func/func.searchers/func.searchers.default/default.pass.cpp | 3 ++- .../func.searchers/func.searchers.default/default.pred.pass.cpp | 3 ++- 11 files changed, 16 insertions(+), 13 deletions(-) (limited to 'libcxx/test/std/experimental') diff --git a/libcxx/test/std/experimental/algorithms/alg.search/search.pass.cpp b/libcxx/test/std/experimental/algorithms/alg.search/search.pass.cpp index 60a44e4c26a..579c13ddc4d 100644 --- a/libcxx/test/std/experimental/algorithms/alg.search/search.pass.cpp +++ b/libcxx/test/std/experimental/algorithms/alg.search/search.pass.cpp @@ -15,7 +15,7 @@ // ForwardIterator search(ForwardIterator first, ForwardIterator last, // const Searcher& searcher); // -// returns searcher.operator(first, last) +// returns searcher.operator(first, last).first // #include @@ -27,10 +27,11 @@ int searcher_called = 0; struct MySearcher { template - Iterator operator() ( Iterator b, Iterator /*e*/) const + std::pair + operator() (Iterator b, Iterator e) const { ++searcher_called; - return b; + return std::make_pair(b, e); } }; diff --git a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/default.pass.cpp b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/default.pass.cpp index 7647b536aa9..4ef70c7cd87 100644 --- a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/default.pass.cpp +++ b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/default.pass.cpp @@ -21,7 +21,7 @@ // Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); // // template -// RandomAccessIterator2 +// pair // operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const; // // private: diff --git a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp index 1323044c870..1162ef66e24 100644 --- a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp +++ b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pass.cpp @@ -21,7 +21,7 @@ // Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); // // template -// RandomAccessIterator2 +// pair // operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const; // // private: diff --git a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp index 8fd5b8c9f78..629a038663a 100644 --- a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp +++ b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/hash.pred.pass.cpp @@ -21,7 +21,7 @@ // Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); // // template -// RandomAccessIterator2 +// pair // operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const; // // private: diff --git a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp index d0655c82feb..9d29cb64e23 100644 --- a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp +++ b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore/pred.pass.cpp @@ -21,7 +21,7 @@ // Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); // // template -// RandomAccessIterator2 +// pair // operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const; // // private: diff --git a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/default.pass.cpp b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/default.pass.cpp index af3bbbafb24..e4d1883c4c7 100644 --- a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/default.pass.cpp +++ b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/default.pass.cpp @@ -21,7 +21,7 @@ // Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); // // template -// RandomAccessIterator2 +// pair // operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const; // // private: diff --git a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp index ff289f0edeb..be116eccb21 100644 --- a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp +++ b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pass.cpp @@ -21,7 +21,7 @@ // Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); // // template -// RandomAccessIterator2 +// pair // operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const; // // private: diff --git a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp index 1150210a978..d63acf08b33 100644 --- a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp +++ b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/hash.pred.pass.cpp @@ -21,7 +21,7 @@ // Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); // // template -// RandomAccessIterator2 +// pair // operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const; // // private: diff --git a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp index 55426874abe..3cd41c7054f 100644 --- a/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp +++ b/libcxx/test/std/experimental/func/func.searchers/func.searchers.boyer_moore_horspool/pred.pass.cpp @@ -21,7 +21,7 @@ // Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); // // template -// RandomAccessIterator2 +// pair // operator()(RandomAccessIterator2 first, RandomAccessIterator2 last) const; // // private: diff --git a/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/default.pass.cpp b/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/default.pass.cpp index 446dcbde42b..a2dbceb7fbb 100644 --- a/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/default.pass.cpp +++ b/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/default.pass.cpp @@ -20,7 +20,8 @@ // : __first_(__f), __last_(__l), __pred_(__p) {} // // template -// _ForwardIterator2 operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const { +// pair<_ForwardIterator2, _ForwardIterator2> +// operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const { // return std::search(__f, __l, __first_, __last_, __pred_); // } // diff --git a/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/default.pred.pass.cpp b/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/default.pred.pass.cpp index b65c500c319..e951b4613dd 100644 --- a/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/default.pred.pass.cpp +++ b/libcxx/test/std/experimental/func/func.searchers/func.searchers.default/default.pred.pass.cpp @@ -20,7 +20,8 @@ // : __first_(__f), __last_(__l), __pred_(__p) {} // // template -// _ForwardIterator2 operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const { +// pair<_ForwardIterator2, _ForwardIterator2> +// operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const { // return std::search(__f, __l, __first_, __last_, __pred_); // } // -- cgit v1.2.3