Say I have :
class Foo
{
public:
int x;
Foo() : x() {}
}
Would it be UB to read x
after the constructor has ran? More specifically, what type of initialization is this, zero, direct or default initialization?
I know if instead we'd have:
Foo() : x(42) {}
x
would be direct-initialized to 42
but I'm not so sure for the snippet above and I don't want to get bit by the UB wolf if this turns out to be default-initialized.