14 Apr
2015
14 Apr
'15
11:48 a.m.
On Tue, Apr 14, 2015 at 1:37 PM, M.A. van den Berg
You can store your objects in a std::set instead of a map and then provide a custom compare function that compared your objects given your key in them. E.g.
struct my_compare { bool operator() (const MyObj& lhs, const MyObj& rhs) const{ return lhs.name < rhs.name; } };
std::set
s;
set entries are const so this isn't usable in all cases. -- Olaf