Question 12
Back to Exercise
What does a custom key type need for std::unordered_map?
- A operator<
- B A hash function and operator== Correct
- C A virtual destructor
- D A default constructor only
Correct Answer: Option B
Ordered containers need operator< (or a comparator) instead.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!