Answer by Zhen for What Is a Curly-Brace Enclosed List If Not an...
You have two different things when use {}A Type std::initializer_list<T> where the values can be implicitly converted to TA type that can be initialized with the values of the list.The first type...
View ArticleAnswer by TartanLlama for What Is a Curly-Brace Enclosed List If Not an...
There are three distinct, but related concepts here:braced-init-list: The grammatical rule associated with curly-brace-enclosed lists in certain contexts.Initializer list: The name for the...
View ArticleAnswer by R Sahu for What Is a Curly-Brace Enclosed List If Not an...
I just thought that any time you did a curly-braced list you were creating an intializer_list.That's not correct.If that's not what's happening, what is a list in curly-braces?struct Foo {int a; int...
View ArticleAnswer by NathanOliver for What Is a Curly-Brace Enclosed List If Not an...
It is an braced-init-list. A braced-init-list existed before std::initializer_list and is used to initialize aggregates.int arr[] = {1,2,3,4,5};The above used a braced-init-list to initialize the...
View ArticleWhat Is a Curly-Brace Enclosed List If Not an intializer_list?
I asked a question here: Lifetime Extension of a initializer_list return involving the non-functional code:const auto foo = [](const auto& a, const auto& b, const auto& c) { return {a, b,...
View Article