This compiles:
int* p1;
const int* p2;
p2 = p1;
This does not:
vector v1;
vector v2;
v2 = v1;
The issue is not the pointers, but the types of the two vectors. There are no standard conversions between templated types like those of v1 and v2 in your example.
This is perhaps easier to see in the following code:
#include
using namespace std;
int main() {
vector cv;
vector iv;
cv = iv; // error
}