I apologize if this was asked before. My search results did not become a similar question.
This is a conceptual question. According to MSDN and others:
A constant member function cannot modify any data elements or call any member functions that are not constants
Why are we allowed to access static member variables from the const method?
The C ++ standard talks about constmember functions:
const
If a member function is declared const, the type of this parameter const X*, [...]- const , , const; - const .
If a member function is declared const, the type of this parameter const X*, [...]
const X*
- const , , const; - const .
, , "" -.
, , , , - const, , this const.
this
this ( ), const.
.