flat_map: add value_comp()

This commit is contained in:
Justin Viiret
2017-01-20 15:45:47 +11:00
committed by Matthew Barr
parent e37fdb240a
commit f520599ab7
2 changed files with 16 additions and 0 deletions

View File

@@ -611,6 +611,21 @@ public:
return comp();
}
class value_compare {
friend class flat_map;
protected:
Compare c;
value_compare(Compare c_in) : c(c_in) {}
public:
bool operator()(const value_type &lhs, const value_type &rhs) {
return c(lhs.first, rhs.first);
}
};
value_compare value_comp() const {
return value_compare(comp());
}
// Operators.
bool operator==(const flat_map &a) const {