Thursday, May 22, 2008

C++ : Little Sugar

mutable keyword is useful in C++ , when you are changing a member variable in side a constant function . A simple way to remove constantness of the "this" pointer is to use code like this

const_cast(this)

No comments: