As you might know,
A::A() {
this->foo = 1;
}
Is the same as:
A::A() : foo(1) {
this->foo = 1;
}
Which is inefficient because of the double declaration.
The compiler might optimize this, but in my case the class is not a POD.
I must define the member in the constructor body since it can't be compressed into one single line.
Is there any way of doing this?