I am wondering if it is a good practice to use the same name for both a member variable and a function parameter in C++.
I come from a Java backgro
There is not really any difference between the C++ and Java, the only drawback is that you have to type this->state = state instead of state = arg.
this->state = state
state = arg
But your code is perfectly acceptable, it's more of styling than anything else.