cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
static data members inside constant func
static data members inside constant function ?
Dec 15, 2009 at 4:37am UTC
kevinchkin
(450)
Hey Guys,
I was reading about bitwise constness. It says that, inside a constant member function we can only modify static members. I was just wondering as to why they allowed even static members to be modified? Shouldn't everything be constant?
Please let me know
Thanks
Dec 15, 2009 at 4:50am UTC
Disch
(13742)
const member functions imply that 'this' is constant. Static variables do not requite the use of 'this' and therefore are not constant.
Dec 15, 2009 at 4:54am UTC
kevinchkin
(450)
Aha. Makes perfect sense. Thanks Disch.
Topic archived. No new replies allowed.