As others have pointed out, this is just a comma-separated list of items. The syntax variable(value)
is just a way to create primitive data types by default, you can use this method outside of initialization lists, for example. Also, if a member of your class is also a class with a constructor, you would name it in exactly the same way.
You are not only required to put the list in the class declaration, but only for future reference. This code is great for example
class Calender{ public: Calender(int month, int day, int year); private: int currentYear; Time time; }; Calender::Calender(int month, int day, int year) : currentYear(year), time(month, day) {
source share