About 20,500 results
Open links in new tab
  1. 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.

  2. 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.

  3. std::unordered_map<Key,T,Hash,KeyEqual,Allocator>::erase

    Dec 4, 2021 · #include <unordered_map> #include <iostream> int main () { std::unordered_map<int, std::string> c = { {1, "one"}, {2, "two"}, {3, "three"}, {4, "four"}, {5, …

  4. 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"; …

  5. std::unordered_map<Key,T,Hash,KeyEqual,Allocator>::

    Dec 4, 2021 · If value_type is not EmplaceConstructible into unordered_map from args, the behavior is undefined. If after the operation the new number of elements is greater than old …

  6. std::unordered_map<Key,T,Hash,KeyEqual,Allocator>::

    Nov 29, 2021 · // Define a const == operator for the class/struct and specialize std::hash // structure in the std namespace std::unordered_map<Foo, std::string> m7 = { {Foo (1), "One"}, …

  7. std::unordered_set<Key,Hash,KeyEqual,Allocator>::

    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: …

  8. Standard library header <unordered_set> (C++11) - Reference

    Nov 27, 2023 · unordered_set (from_range_t, R && rg, size_type n, const allocator_type & a) : unordered_set (from_range, std::forward<R>(rg), n, hasher (), key_equal (), a) { } …

  9. std::unordered_set<Key,Hash,KeyEqual,Allocator>::

    Nov 21, 2021 · 13-15) Initializer-list constructor. Constructs the container with the contents of the initializer list init, same as unordered_set(init.begin(), init.end()). 16-18) Constructs the …

  10. std::unordered_map<Key,T,Hash,KeyEqual,Allocator>::

    May 9, 2025 · One way to check success of a hinted insert is to compare size() before and after. Example Run this code #include <iostream> #include <string> #include <unordered_map> int …