If you namespace your private data with a struct, you will avoid the name clashes.
class A {
public:
int a() const { return data.a; }
int b() const { return data.b; }
int c() const { return data.c; }
private:
struct {
int a, b, c;
} data;
};
class A {
public:
int a() const { return data.a; }
int b() const { return data.b; }
int c() const { return data.c; }
private:
struct {
int a, b, c;
} data;
};
To copy to clipboard, switch view to plain text mode
Because the struct itself is inlined, the compiler will optimize away the dereferencing.
Bookmarks