Obtain iterator from pointer or reference
问题 I would like to know if it is possible to obtain an iterator to an object inside a container (e.g. std::vector<...> ) by only having access to the object inside the container, e.g. through a reference (which implies we have access to a pointer to it using the & operator). For example, normally we declare an iterator as std::vector<int>::iterator = vec.begin(); or std::vector<int>::iterator = next(vec.begin(), idx); but in the first example we are most probably about to iterate through the