I would like to report what I will call "constructor ambiguity" for classes which have multiple constructors, one of which have takes an initializer list.The ambiguity is for us humans, not the compiler, and is due to the two things:
- The same syntax is used for uniform initialization and initializer lists.
- Any constructor taking an initializer list is preferred when braces are used.
Simple guidelines for variable initialization in C++:
Use initializer-list syntax {} only for element initializers (of containers and aggregates).
Use function-call syntax () to call a constructor, viewed as an object-factory.