About 36,600 results
Open links in new tab
  1. std::unordered_set - cppreference.com

    Apr 26, 2025 · std::unordered_set meets the requirements of Container, AllocatorAwareContainer, UnorderedAssociativeContainer. All member functions of std::unordered_set are constexpr : it is possible to create and use std::unordered_set objects in the evaluation of a constant expression.

  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. Internally, the elements are not sorted in any particular order, but organized into buckets.

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

    Dec 4, 2021 · #include <cstddef> #include <functional> #include <iostream> #include <string> #include <string_view> #include <unordered_map> using namespace std:: literals; struct string_hash {using hash_type = std:: hash < std:: string_view >; using is_transparent = void; std:: size_t operator (const char * str) const {return hash_type {} (str);} std:: size ...

  4. std::unordered_set<Key,Hash,KeyEqual,Allocator>:: insert - Reference

    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 KeyEqual are both transparent.

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

    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 max_load_factor() * bucket_count() a rehashing takes place.

  6. 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, "five"}, {6, "six"}}; // erase all odd numbers from c for (auto it = c. begin (); it ! = c. end ();) {if (it-> first % 2! = 0) it = c. erase (it); else ++ it;} for (auto & p : c) std:: cout ...

  7. 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 "; else std:: cout << x <<": Not found \n ";}

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

    Nov 27, 2023 · <unordered_set> (C++11) <vector> Iterators <iterator> Ranges <generator> (C++23) <ranges> (C++20)

  9. std::unordered_multimap - cppreference.com

    Apr 26, 2025 · The unordered_multimap class supports forward iterators. Search, insertion, and removal have average constant-time complexity. Internally, the elements are not sorted in any particular order, but organized into buckets.

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

    Nov 21, 2021 · unordered_set (std:: initializer_list < value_type > init, size_type bucket_count, const Allocator & alloc ) : unordered_set (init, bucket_count, Hash (), key_equal (), alloc) {}

Refresh