What is

Unordered sets are containers that store unique elements in no particular order, and which allow for fast retrieval of individual elements based on their value.

How to Use

  • find()
    The unordered_set::find() function is a built-in function in C++ STL which is used to search for an element in the container. It returns an iterator to the element, if found else, it returns an iterator pointing to unordered_set::end().

  • insert()

  • earse()

  • count()
    Returns the number of elements with key that compares equal to the specified argument key, which is either 1 or 0 since this container does not allow duplicates.

std::unordered_set - cppreference.com