cpr->Get(); // cpr->Set(1); // ERROR: const ptr cant use non-const method // cpr->c = 3; // ERROR: an immutable left value int c = cpr->c; // OK: read as ref cpcr->Get(); // cpcr->Set(1);
cpr = &r; // OK: ptr object is not const :) cpcr = &cr;
Const ptr to a value
1 2 3 4 5 6 7 8 9 10
FR * const prc = &r; // FR * const pcrc = &cr; // ERROR: const ptr, but mutable to value