I know that a good way to prevent duplicates is to use an unordered_set
. However, this method does not seem to work when I want to have an unordered_set<vector<string>>
. How can I go about doing this? For example, I want to prevent <"a", "b", "c">
from being duplicated in my unordered_set<vector<string>>
.
Can this unordered_set<vector<string>>
be used outside the defined class as well?
Code:
unordered_set<vector<string>> abc({"apple", "ball", "carrot"});
abc.insert({"apple", "ball", "carrot"});
cout << abc.size() << endl; //abc.size() should be 1