Here is the code snippet.
Why std::unordered_set<std::vector<int>>
does not compile whereas std::unordered_set<int>
is ok?
Could someone please give me a detailed explanation?
UPDATE: Here is the error messages:
error: use of deleted function 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set() [with _Value = std::vector<int>; _Hash = std::hash<std::vector<int> >; _Pred = std::equal_to<std::vector<int> >; _Alloc = std::allocator<std::vector<int> >]'
...
Tips: Sorry, I can't fully understand the error message.
#include <vector>
#include <algorithm>
#include <unordered_set>
#include <iostream>
#include <vector>
int main()
{
std::unordered_set<std::vector<int>> set_of_vector; //Why this one goes wrong?
std::unordered_set<int> set_of_int;
return 0;
}