Const method accessing static variables

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?

+5
source share
2 answers

The C ++ standard talks about constmember functions:

If a member function is declared const, the type of this parameter const X*, [...]

- const , , const; - const .

, , "" -.

, , , , - const, , this const.

this ( ), const.

+9

.

+13

All Articles