Custom types as key for a map - C++
- by Appu
I am trying to assign a custom type as a key for std::map. Here is the type which I am using as key.
struct Foo
{
Foo(std::string s) : foo_value(s){}
bool operator<(const Foo& foo1) { return foo_value < foo1.foo_value; }
bool operator>(const Foo& foo1) { return foo_value > foo1.foo_value; }
std::string…