About six years ago, a software engineer named Harri Porten wrote this article, asking the question, \"When should a member function have a const qualifier and when shouldn\'t i
General rule:
A member function should be
const
if it both compiles when marked asconst
and if it would still compile ifconst
were transitive w.r.t pointers.
Exceptions:
const