Addition to the C++17 standard

I’m really excited about all the cool ways in which the C++ standard is developing. One of the updates I really like is a new set of rules for auto deduction of braced-initialized lists for C++17. In a nutshell, it allows you to declare and initialize a variable without specifying its type:

 auto aVar{ 5 }; // aVar type is an int
 auto anotherVar = { 6, 7 }; // anotherVar is std::initializer_list

Not sure when this will be supported by the latest compilers.

Leave a Reply

Your email address will not be published. Required fields are marked *