Returns a copy of the comparison object used by the container to compare keys.

By default, this is a less object, which returns the same as operator<.

This object determines the order of the elements in the container: it is a function pointer or a function object that takes two arguments of the same type as the element keys, and returns true if the first argument is considered to go before the second in the strict weak ordering it defines, and false otherwise.

Two keys are considered equivalent if key_comp returns false reflexively (i.e., no matter the order in which the keys are passed as arguments).

Parameters

none

Return value

The comparison object.
Member type key_compare is the type of the comparison object associated to the container, defined in multimap as an alias of its third template parameter (Compare).