Can you change state in a const function in C++? Why? How?
bytesandlogs.me
Can you change state in a const function in C++? Why? How?
1–2 of 2 posts
Re: Can you change state in a const function in C++? Why? How?
#2The author hacks it in using const_cast (https://en.cppreference.com/w/cpp/language/const_cast), but doesn’t seem to know mutable (https://en.cppreference.com/w/cpp/language/cv#mutable) exists for this purpose.