Reputation: 233
class A {};
A a;// 1
A a{};// 2
A a = {};// 3
A a = A();// 4
There seems to be all options. Are 1, 2 and 3 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?
Upvotes: 0
Views: 95
Reputation: 238461
A
however, because there are no members to initialise.Upvotes: 2