Candidates for use of const

So this is pretty old, but I think that
int GetMaxTries();
int GetCurrentTry();
bool IsGameWon();
bool CheckGuessValidity(std::string);
are candidates for const
except for void reset();
Not sure if that’s correct.

1 Like

I would completely agree. Pretty much all of those have no reason to touch variables. Reset will need to change variables or at the least start functions that might need to change variables.

That there leads to a question of what happens then. If a function inside of a const function changes a value is it allowed?

Not sure tbh.

1 Like

Almost all the current methods except the one for resetting should have const to prohibit the changing of variables. I think some set methods will have to be added to alter the variables, and of course those will not have const use.

Privacy & Terms