I tried to follow google c++ style guide . i have a setter for private memeber – age.
My problem is what should be the name of the setAge argument?
In java i have both the same name and ditinguish between them by using the this keyword.
void setAge(int age){
this.age = age;
}
What is the coding style to do this in c++ (google coding style is preferred).
The google C++ coding standards suggest that you add a trailing underscore to class data members. I think it is very important to follow this, otherwise you are guaranteed to hide a class data member with a local variable name.
Concerning getters and setters, I personally find
getXandsetXconvenciton tedious, when it is obvious what a method does.