I need to store unique objects in a container. The object provides a
There's indeed no standard container, and that's because it would be inefficient.
O(N), to be precise - exactly the brute force search you imagine.
std::unordered_set<T> avoid a brute-force search by taking advantage of a non-trivial property of T. Lacking either property, any of the existing N members of a container could be equal to a potential new value V, and you must therefore compare all N members using