This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: A C++ question
- From: "John (Eljay) Love-Jensen" <eljay at adobe dot com>
- To: "Aseem Rastogi" <aseem at india dot tejasnetworks dot com>, <gcc-help at gcc dot gnu dot org>
- Date: Fri, 18 May 2007 08:10:17 -0700
- Subject: RE: A C++ question
- References: <464DB405.5080303@india.tejasnetworks.com>
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