I thought that. But you'll have to create a vector of vector of obj*, iterate through them, check if the have the obj* with std::find and return a reference. Does this look good?
I have a pointer of an element, but I don't know which vector it belongs to. Is there anyway to find the vector by that pointer?
Brute Force: Compare the address of the element that you have against every element within every vector; not the pointer's address, but the address of the object that is being pointed to.
Pehaps a vector is not the most appropriate container type.
If the objects have a unique key, a std::map might be more suited to your problem.
You would still have multiple containers to search, but with a map, you can efficiently search for an object in each container.