For example:
vector<int> v = {1, 2, 3};
unordered_set<vector<int>> s;
s.insert(v);
will gives error
no match for call to '(const std::hash >) (const std::vector&)' noexcept(declval()(declval()))>
For example:
vector<int> v = {1, 2, 3};
unordered_set<vector<int>> s;
s.insert(v);
will gives error
no match for call to '(const std::hash >) (const std::vector&)' noexcept(declval()(declval()))>
Because most of the C++ containers don't? vector<bool>
appears to have an explicit specialization, but that's the unusual case; typically, they didn't provide std::hash
overloads for aggregate or collection types (possibly because they didn't want to lock in a hash combining algorithm applicable to arbitrary templated types).