void Foo(int* x) { (*x)++; } void Bar(const int* x) { // Foo(x); // compiler error Foo(const_cast(x)); // succeeds } int main(int argc, char** argv) { int x = 7; Bar(&x); return 0; }