cppreference.com > C++ Maps > Map operators
Map operators
Syntax:
  #include <map>
  TYPE& operator[]( const key_type& key );
  map operator=(const map& c2);
  bool operator==(const map& c1, const map& c2);
  bool operator!=(const map& c1, const map& c2);
  bool operator<(const map& c1, const map& c2);
  bool operator>(const map& c1, const map& c2);
  bool operator<=(const map& c1, const map& c2);
  bool operator>=(const map& c1, const map& c2);

Maps can be compared and assigned with the standard comparison operators: ==, !=, <=, >=, <, >, and =. Individual elements of a map can be examined with the [] operator.

Performing a comparison or assigning one map to another takes linear time.

Two maps are equal if:

  1. Their size is the same, and
  2. Each member in location i in one map is equal to the the member in location i in the other map.

Comparisons among maps are done lexicographically.