Limits to Map Key

What are the requirements for the type of the key of a std::map?

On this page (http://www.cplusplus.com/reference/map/map/), I noticed that the key type has to enforce a strict ordering (which I interpret to mean implementing operator<). Is this the only requirement for the type of the key?
> Is this the only requirement for the type of the key?

Yes. Other than the obvious requirements of being CopyAssignable and Destructible.
Strict weak ordering means that operator< should behave in a certain way. If a < b and b < c then you should also have that a < c. a < a should always return false. By testing if a < b and b < a both returns false is how they can know that a and b are equal.
Topic archived. No new replies allowed.