Which functions could be made const

So,

Reset() should definitely not be made const because it has to reset values - change values.
IsGameWon() could be made const because it just returns a boolean - it doesn’t have to change anything.
CheckGuessValidity() shoudln’t be made const because we may use it to modify MyCurrentTry or other attributes. But of course, if this function wouldn’t have to change anything we could also make it const.

Those are my thoughts. Have a nice day!

Thanks for sharing this. Keep up the great work.

Privacy & Terms