Can I create a unordered_set of vectors in C++? something like this
std::unordered_set<std::vector<int>> s1;
because I know that is possible with the "set" class of the std lib but seems that it doesn't work for the unordered version thanks
Update: this is the exactly code that I'm trying to use
typedef int CustomerId;
typedef std::vector<CustomerId> Route;
typedef std::unordered_set<Route> Plan;
// ... in the main
Route r1 = { 4, 5, 2, 10 };
Route r2 = { 1, 3, 8 , 6 };
Route r3 = { 9, 7 };
Plan p = { r1, r2 };
and it's all right if I use set, but I receive a compilation error when try to use the unordered version
main.cpp:46:11: error: non-aggregate type 'Route' (aka 'vector<CustomerId>') cannot be initialized with an initializer list
Route r3 = { 9, 7 };
std::unordered_set<std::vector<int>>
actually? – Ddenestd::unordered_set<std::vector<some_type>>
– Shadufr3
fails but not thePlan
constructor? – Ahl