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()
Theunordered_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 tounordered_set::end()
. -
insert()
-
earse()
-
count()
Returns the number of elements with key that compares equal to the specified argumentkey
, which is either 1 or 0 since this container does not allow duplicates.
Links
std::unordered_set - cppreference.com
https://cplusplus.com/reference/unordered_set/unordered_set/