C++ Logo


Advanced search


From: Marcin Jaczewski <marcinjaczewski86_at_[hidden]>
Date: Fri, 24 Mar 2023 22:14:37 +0100
I recently looked at `std::unordered_map` and noticed a bit of a
bizarre handling of `std::hash` in the standard library.
Why of all types that could be useful, does the standard define only
Where `std::tuple` or other vectors are left unusable.

What is the reason for standard not defining
`std::hash<std::vector<T>>` if `T` has a hash?
And why is `bool` the only exception there? What was the motivation for this?

Received on 2023-03-24 21:14:50