Coming from python, where you would assign a member with the self
keyword i wonder what the behaviour would be in C++ without using this
keyword, since the compiler takes care of assigning members.
In other words, what happens when i do this:
class SomeClass
{
private:
int someVariable;
public:
void setSomeVariable(int someVariable);
};
void SomeClass::setSomeVariable(int someVariable)
{
someVariable = someVariable;
}
Since the compiler does not complain i wonder if that is a correct way for writing accessors for members by convention and if the behaviour is determined( unlike for instance the evaluation of function arguments in C++)