I wanted to defined a map like
std::unordered_map<int, std::unordered_set<int>>
or
std::unordered_map<int, std::unique_ptr<std::unordered_set<int>>>
I am not sure which one is better.
I cannot see if the first one has any problem. In terms of Does std::map::iterator return a copy of value or a value itself? the first is safe because the access of each set of a map should also be of reference type.
If so, which one is better?