C++11: Initializer Lists Explained with Simple Example

In C++11 (Introduction to C++11), Initializer lists are a major addition to the C++ language. In this post we are focusing on Initializer lists with some coding examples.

To understand Initializer lists, we need to first understand the constructors. Constructors are special member functions of a class which is used to initialize the object in desired way. Constructors has the same name as that of class. There could be multiple constructors defined in a class which could be selected based on invoking conditions.

(more…)
C++11: Initializer Lists Explained with Simple Example Read More