A C++ question

John (Eljay) Love-Jensen eljay@adobe.com
Fri May 18 15:12:00 GMT 2007


Hi Aseem,

My concern is how could this code compile when in bar () function of 
class A, I am calling non const function on pointer b ?

The pointer b data member is const in that context.  Think "B* const b;".  Do not think "B const* b;".

It does not matter that the object pointed to by the const pointer is not const.

HTH,
--Eljay



More information about the Gcc-help mailing list