Compare

All the general comparison operators work on containers.

Containers support the comparison operators ==, !=, <, >, <=, >=. The comparison of two containers happens on the elements of the containers. If you compare associative containers, their elements and sizes are compared. Unordered associative containers support only the comparison operator == and !=.

Get hands-on with 1200+ tech skills courses.