I apologize if this has been asked before. My search results did not turn up a similar question.
This is a conceptual question. According to MSDN and others as well:
A constant member function cannot modify any data members or call any member functions that aren't constant
Why then are we allowed to access static member variables from a const method?
Because they are not part of the object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With