Like: It makes the 'most vexing parse' problem history.
1 2 3 4
struct A { A() ; /* ... */ } ; struct B { B(A) ; /* ... */ } ;
B foo( A() ) ; // declares a function
B bar{ A{} } ; // defines an object
Like: I can now think of initializing an object logically rather than syntactically; for instance as "an object that can be initialized with five integers".
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <vector>
#include <tuple>
#include <iostream>
template < typename T > T get_numbers() { return T { 0, 1, 2, 3, 4 } ; }
int main()
{
auto vector = get_numbers< std::vector<int> >() ;
auto tuple = get_numbers< std::tuple<char,short,int,long,longlong> >() ;
struct B { int a, b ; long c, d ; short e ; } ;
B b = get_numbers<B>() ;
}
Don't like: Uniform initialization can't be used as a drop-in replacement for all initialization; it clashes with initializer lists.