unordered_set<vector<int>>

1,638 views
Skip to first unread message

Andrew Tomazos

unread,
Feb 4, 2016, 5:03:02 AM2/4/16
to std-discussion
Am I right in understanding that std::vector doesn't have a std::hash specialization and hence unordered_set<vector<int>> won't compile?

If so, why doesn't std::vector have a std::hash specialization?

Was such a thing proposed and rejected for some reason?

Ville Voutilainen

unread,
Feb 4, 2016, 5:25:39 AM2/4/16
to std-dis...@isocpp.org
On 4 February 2016 at 12:02, Andrew Tomazos <andrew...@gmail.com> wrote:
> Am I right in understanding that std::vector doesn't have a std::hash
> specialization and hence unordered_set<vector<int>> won't compile?

Sure.

>
> If so, why doesn't std::vector have a std::hash specialization?

Because there was no time to figure out how to do it for C++11 or C++14.

>
> Was such a thing proposed and rejected for some reason?

We have http://open-std.org/JTC1/SC22/WG21/docs/papers/2015/p0029r0.html
and
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3980.html
neither of which has been adopted or rejected yet. They are under review.
Reply all
Reply to author
Forward
0 new messages