mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 18:38:30 +08:00
Implement P0253R1: Fixing a design mistake in the searchers interface.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@262928 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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 <experimental/algorithm>
|
||||
@@ -27,10 +27,11 @@ int searcher_called = 0;
|
||||
|
||||
struct MySearcher {
|
||||
template <typename Iterator>
|
||||
Iterator operator() ( Iterator b, Iterator /*e*/) const
|
||||
std::pair<Iterator, Iterator>
|
||||
operator() (Iterator b, Iterator e) const
|
||||
{
|
||||
++searcher_called;
|
||||
return b;
|
||||
return std::make_pair(b, e);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user