An array is initialized by default, which means that its elements are initialized by default one by one. Since your array contains user-defined types, this means that their default constructor will be called. If built-in types or PODs are stored in your array, you must be explicit and initialize the value, since the default initialization means that the initialization is not performed on the elements:
anOtherObject() : array() {}
source share