Y
Hacker News
new
|
ask
|
show
|
jobs
Can you change state in a const function in C++? Why? How?
(
bytesandlogs.me
)
3 points
by
itskarad
714 days ago
1 comments
Someone
714 days ago
The 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.
link