I recently stumbles across some problem with initializer lists. Consider a program that stores map-like data
struct MyMapLike {
MyMapLike(std::map
You could initialize as follows:
MyMapLike maps ( { { "One", 1 }, { "Two", 2 } } );
The outer ( ... ) are now clearly simply to surround the constructor args, and it's easier to see that the outermost { ... } defines the 'list'.
It's still a bit verbose, but it avoids the situation where { is being used to do two different things, which affects readability.