So far I've found following uses of list initialization (a.k.a. uniform initialization).
1) Before Introduction was list initialization feature
int a=3.3f; // ouch fractional part is automatically truncated But in C++11
int a{3.3f}; // compiler error no implicit narrowing conversion allowed 2) Dynamic array elements can be initialized statically. See for example this program is invalid in C++03 but valid since C++11:
#include <iostream> int main() { int* p=new int[3]{3,4,5}; for(int i=0;i<3;i++) std::cout<<p[i]<<' '; delete[] p; } 3) It solves most vexing parse problem
It would be better if you tell me other advantages of list initialization. Are there still any advantages of list initialization except above 3?
Your answer is highly appreciated.