1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
template <class Key, class T, class Compare, class Alloc>
class multimap<Key,T,Compare,Alloc>::value_compare
{ // in C++98, it is required to inherit binary_function<value_type,value_type,bool>
friend class multimap;
protected:
Compare comp;
value_compare (Compare c) : comp(c) {} // constructed with multimap's comparison object
public:
typedef bool result_type;
typedef value_type first_argument_type;
typedef value_type second_argument_type;
bool operator() (const value_type& x, const value_type& y) const
{
return comp(x.first, y.first);
}
}
|