Hash Sets using std::unordered_set

This lesson provides a thorough understanding of std::unordered_set, from basic initialization to handling custom types and collisions

Ryan McCombe
Updated
Hello! I'm here to help you with any questions about this lesson. Feel free to ask me anything - whether it's about specific concepts, examples, or how to apply what you've learned!

Questions & Answers

Answers are generated by AI models and may not have been reviewed. Be mindful when running any code on your device.

Implementing a Custom Hash Function
How can I implement a custom hash function for my user-defined type to use with std::unordered_set?
Erasing Elements while Iterating
Is it safe to erase elements from a std::unordered_set while iterating over it?
Using a Custom Allocator with std::unordered_set
How can I use a custom allocator with std::unordered_set?
Difference between rehash() and reserve()
What is the difference between rehash() and reserve() in std::unordered_set?
Using std::unordered_set with Smart Pointers
How can I store smart pointers like std::unique_ptr in a std::unordered_set?
Checking if a Key Exists without Inserting
How can I check if a key exists in a std::unordered_set without inserting it if it doesn't?