struct A
{
int a;
std::string str;
};
A a;// 1
A a{};// 2
A a = {};// 3
A a = A();// 4
There seems to be all options. In case 1 and 4 a will be uninitialized, in 2 and 3 a will be initialized with zero and they both are same and just the matter of style or there is some difference? 4 supposed to first create a temporary object and then assign it to an a, but it will happen only if I will turn off comliler's optimization completely, right?
aanda.aare both initialized