44{
45 std::vector<FwdIt> itvec;
46 std::pair<FwdIt, FwdIt> adjpr1 =
adjacent_find_if( first, last, if_pred, adj_pred );
47 if (adjpr1.second == last) return itvec;
48
49 itvec.push_back( adjpr1.first);
50 itvec.push_back( adjpr1.second );
51 std::pair<FwdIt, FwdIt> adjpr2;
52
53 while ((itvec.size() < N) && (adjpr1.second != last)) {
55 if (adjpr2.second == last) return std::vector<FwdIt>();
56 if (adj_pred((*adjpr1.second), (*adjpr2.second))) itvec.push_back(adjpr2.second);
57 else {
58 itvec.clear();
59 itvec.push_back(adjpr2.first);
60 itvec.push_back(adjpr2.second);
61 }
62 adjpr1.second = adjpr2.second;
63 }
64 return itvec;
65}
std::pair< FwdIt, FwdIt > adjacent_find_if(const FwdIt &first, const FwdIt &last, UniPred if_pred, BinPred adj_pred)