Initializer List

Let us understand the concept of initializer list in C++ with the help of an example. Consider a class viz. person, which has data members like age, name and employee dataExample #include <iostream>#include <string>using namespace std;class employeeData { unsigned int m_salary; public: employeeData() { cout << “employeeData default C’tor” << endl; m_salary = 0; }employeeData(unsigned int salary) { cout << “employeeData parameterized C’tor” << endl; m_salary = salary; }employeeData(const employeeData& data) { cout << “employeeData Copy C’tor” << endl; m_salary = data. m_salary; }employeeData& operator=(const employeeData& data) { cout <<…