Default initialization in C++11?
I am not sure which style should I use:
T o; T o{}; Is there difference?
T o; performs default initialization (in particular, it leaves non-class members uninitialized)
T o{}; performs value initialization (in particular, it zeroes out non-class members)
T has a user defined default constructor or whether any of the members are initialized at the point of declaration.
T o;is most common. Also, do you meanT o();?T o{};won't work on old compilers, and it may scare some people who are out of touch.