Page MenuHomePhabricator

(An Untitled Masterwork)
ActivePublic

Authored by Bigcheese on Oct 29 2012, 1:30 PM.
#include <algorithm>
#include <utility>
#include <vector>
using namespace std;
struct Comp {
bool operator ()(const pair<int, char> &p, int i) {
return p.first < i;
}
bool operator ()(int i, const pair<int, char> &p) {
return i < p.first;
}
};
int main() {
vector<pair<int, char>> v = {{1, 'A'}, {2, 'B'}, {2, 'C'}, {3, 'D'}};
auto it = equal_range(v.begin(), v.end(), 2, Comp());
}

Event Timeline

Bigcheese edited the content of this paste. (Show Details)Oct 29 2012, 1:30 PM
martini.mwn mentioned this in Unknown Object (File).Nov 16 2020, 5:45 PM