First example:
int main(){
using namespace std;
vector v1{10, 20, 30, 40, 50};
vector v2{10, 20, 30, 40, 50};
if(v1==v2
You can check the documentation of operator==
for vector: operator==,!=,<,<=,>,>=(std::vector)
Quoting from the link:
template< class T, class Alloc >
bool operator==( vector& lhs,
vector& rhs );
Compares the contents of two containers.
Checks if the contents of lhs and rhs are equal, that is, whether lhs.size() == rhs.size() and each element in lhs has equivalent element in rhs at the same position.
parameters:
lhs, rhs containers whose contents to compare
T must meet the requirements of EqualityComparable in order to use versions
Return value
true if the contents of the containers are equivalent, false otherwise