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_va
It's probably looking for const member operators (whatever the correct name is). This works (note const):
bool operator<(const Foo& foo1) const { return foo_value < foo1.foo_value;}
EDIT: deleted operator>
from my answer as it was not needed (copy/paste from question) but it was attracting comments :)
Note: I'm 100% sure that you need that const because I compiled the example.