If you want an unordered set, use std::unordered_set; it'll make the code more clear.