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
I suspect you need
bool operator<(const Foo& foo1) const;
Note the const after the arguments, this is to make "your" (the left-hand side in the comparison) object constant.
The reason only a single operator is needed is that it is enough to implement the required ordering. To answer the abstract question "does a have to come before b?" it is enough to know whether a is less than b.