
std:: unordered_map - cppreference.com
Apr 26, 2025 · std::unordered_map is an associative container that contains key-value pairs with unique keys. Search, insertion, and removal of elements have average constant-time complexity.
std:: unordered_set - cppreference.com
Apr 26, 2025 · std::unordered_set is an associative container that contains a set of unique objects of type Key. Search, insertion, and removal have average constant-time complexity.
Standard library header <unordered_set> (C++11) - Reference
Nov 27, 2023 · std::swap(std::unordered_set) (C++11) specializes the std::swap algorithm (function template) [edit] erase_if(std::unordered_set) (C++20) erases all elements satisfying …
std::unordered_set<Key,Hash,KeyEqual,Allocator>:: unordered_set
Nov 21, 2021 · unordered_set( unordered_set&& other, const Allocator& alloc ); (12) (since C++11) unordered_set(std::initializer_list<value_type> init, size_type bucket_count =/* …
std::unordered_map<Key,T,Hash,KeyEqual,Allocator>:: contains
Nov 5, 2023 · #include <iostream>#include <unordered_map>int(){std::unordered_map<intchar>{{1'a'}{2'b'}};for(int:{25})if(contains())std::cout<<<<": …
std::unordered_map<Key,T,Hash,KeyEqual,Allocator>:: erase
Dec 4, 2021 · #include <unordered_map>#include <iostream>int(){std::unordered_map<intstd::string>={{1"one"}{2"two"}{3"three"}{4"four"}{5"five"}{6"six"}};// …
std::unordered_map<Key,T,Hash,KeyEqual,Allocator>:: emplace
Dec 4, 2021 · The constructor of the new element (i.e. std::pair<const Key, T>) is called with exactly the same arguments as supplied to emplace, forwarded via …
std::unordered_set<Key,Hash,KeyEqual,Allocator>::contains ...
Nov 5, 2023 · #include <iostream> #include <unordered_set> int main () { std::unordered_set<int> example {1, 2, 3, 4}; for (int x : {2, 5}) if (example. contains(x)) std::cout << x << ": Found\n"; …
std::unordered_set<Key,Hash,KeyEqual,Allocator>:: insert
May 9, 2025 · The value_type must be EmplaceConstructible into unordered_set from std::forward<K>(obj). This overload participates in overload resolution only if Hash and …
Standard library header <unordered_map> (C++11) - Reference
Nov 27, 2023 · unordered_map (initializer_list <pair <Key, T>>, Allocator) -> unordered_map <Key, T, hash <Key>, equal_to <Key>, Allocator>; template<class Key, class T, class Hash, …