Is there a standard way to compare two ranges in C++?
std::equal
is the function template you are looking for.
if (std::equal(v1.begin() + 1, v1.end() - 1, v2.begin())
{
std::cout << "Alright\n";
}
Note that std::equal
only takes three arguments, not four.
Use std::equal
- it supports ranges as well.