On Mar 19, 9:35 am, (e-mail address removed) wrote:
Yes you can. I don't believe it's a good idea because it can
lead to confusion, and maintainability issues.
In general, I agree. But for very simple "classes", with all
data members public, I'll sometimes make an exception.
What you want to do will work in an initialization list, I
don't believe it will work inside the constructor body.
Inside the constructor body, the name refers to the parameter
(which hides the member); you can always access the member using
this->, however.
Is it so hard to add a trailing _ to either your constructor
parameters or to your member variables?
It is if you have any esthetic sensibility

.
Generally speaking, the case should rarely occur. Variable
names are qualified nouns; the parameters will have names
like newSomething or initialSomething, whereas the members will
have names like mySomething (or ourSomething, in the case of
static members).