Top "Unordered-set" questions

`std::unordered_set` is an associative container that contains set of unique objects.

Storing elements in an unordered_set vs storing them in an unordered_map

Suppose I have the following User struct: struct User { string userId; UserType userType; // UserType is just an enumeration string hostName; …

c++ data-structures unordered-map unordered-set
std::vector faster than std::unordered_set?

In my custom physics engine, the biggest bottleneck is a method that gets all bodies from the spatial partitioning (a 2…

c++ performance vector stl unordered-set
How can I use a C++ unordered_set for a custom class?

How can I store objects of a class in an unordered_set? My program needs to frequently check if an …

c++ unordered-set hash-function
Is there a default hash function for an unordered_set of a custom class?

I'm using a std::unordered_set for the first time and have a question about the hash function. As far …

c++ hash unordered-set
How to use unordered_set that has elements that are vector of pair<int,int>

I wanted to have something like unordered_set<vector<pair<int,int>>> us; but …

c++ c++11 unordered-map unordered-set
Why can't I use pair as key of unordered_set / unordered_map?

Both std::set<> and std::map<> can use a std::pair as a key, but why …

c++ dictionary set unordered-map unordered-set
Using C++11 unordered_set in Visual C++ and clang

I'am trying to use std::unordered_set in cross-platform C++ application. It compiles and works like a charm in Visual …

c++ visual-c++ c++11 clang unordered-set
Random element from unordered_set in O(1)

I've seen people mention that a random element can be grabbed from an unordered_set in O(1) time. I attempted …

c++ stl unordered-set
How to make a c++11 std::unordered_set of std::weak_ptr

I have a set like this: set<weak_ptr<Node>, owner_less<weak_ptr<Node&…

c++ c++11 std unordered-set weak-ptr
Using a std::unordered_set of std::unique_ptr

Assume I have a set of unique_ptr: std::unordered_set <std::unique_ptr <MyClass>> my_…

c++ c++11 stl unique-ptr unordered-set