I have a simple object that holds some [public] data.
I want to keep my interface clean, so I don't want to pre-/post- fix anything to the names of the publically accessible variables nor to the names of my function arguments.
That said, I ended up doing something like this:
template<typename T> struct Foo
{
explicit Foo(T x) : x(x) // This [i.e., x(x)] seems to be doing the "Right Thing", but is this well defined?
{/* ^
No pre-/post- fixing.
*/
}
T x; // No pre-/post- fixing.
};
Just to reiterate: All I'm asking is whether this is well defined behavior. Not whether I should or shouldn't be doing this...
Thanks.