In C#, there is a nice syntax sugar for fields with getter and setter. Moreover, I like the auto-implemented properties which allow me to write
public Foo foo { get; private set; }
In C++ I have to write
private:
Foo foo;
public:
Foo getFoo() { return foo; }
Is there some such concept in the C++11 allowing me to have some syntax sugar on this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…