Consider the code
#include
class Foo
{
int val_;
public:
Foo(std::initializer_list il)
{
std::cout <<
The whole initializer list thing was meant to enable list initialisation like so:
std::vector v { 0, 1, 2 };
Consider the case
std::vector v { 123 };
That this initializes the vector with one element of value 123 rather than 123 elements of value zero is intended.
To access the other constructor, use the old syntax
Foo foo(10);