RE: A C++ question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux