I am trying to see if vector v1 is contained within vector v2. My vectors are ordered and it is required that the order is preserved.
For example, if v1= (a, b) and v2 = (e, f, a, b), I would like to get an iterator pointing to a in v2.
STL find only finds one object inside a vector. I guess what I want is something similar to string::find.
Is there any function in STL for doing this?
It looks like you want to search for a subsequence inside another sequence. You can do that with
std::searchfrom the Standard Library.