Demo Code: This is the driver code
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> v1={} ;
cout<<v1.size()-1;
}
Output: Upon execution
18446744073709551615
EDIT
We can simply use static_cast<int>(v1.size()-1)
to rule out unsigned behaviour and overflow.