What is the rationale for the way C++ handles uniform initialization with initialization lists?
问题 C++'s uniform initialization syntax fixes the most vexing parse. Yay. But then it introduces confusion when dealing with initialization lists. Boo. The existing behavior is that: std::vector<int> the_vec{4}; will invoke std::vector(std::initializer_list<T> init) instead of std::vector(size_type count); . What is the rationale for this decision? Especially since the language committee was inventing new syntax, it seems to me the other possible designs could have been: Require initialization