Inside Hi::Testing
, the hi
object "is const". Which means the pointer hello
can't be modified inside that method. (It is as if hello
had been defined as Hello * const hello;
for the duration of that method.)
But this doesn't mean that hello
is transformed into a pointer-to-const (which would look like Hello const * const hello;
). The object pointed to by hello
isn't const, so you can invoke its non-const methods without restriction.