Reputation: 1894
I want to create a tuple/array like (0,1,2), (3,4,5)
. I want to store it into an unordered_set
. But unordered_set
didn't offer such a hash function. Can anyone tell me how can I do this?
I have read thes answer: C++ how to insert array into hash set? but I don't want to add any extra code like hash function.
Upvotes: 2
Views: 4946
Reputation: 238341
I want to store [array] into an unordered_set
unordered_set didn't offer such a hash function
I don't want to add any extra code like hash function.
Tough luck. A hash function is mandatory. Since it's not provided by the standard library, it must be provided by you. The answer in the question you linked shows how to write a hash function for std::array
.
Upvotes: 1