The compiler does not support the following initialization features:
- When an array of a class type T is a sub-object of a class object, each array element is initialized by the constructor for T. Example:
Listing: Example - Unsupported Initialization Features
class A{
public:
A(){}
};
class B{
public:
A x[3];
B(){};
};
B b; /*the constructor of A is not called in order to initialize the
elements of the array*/
- Creating and initializing a new object (call constructor) using a new-expression with one of the following forms:
- (void) new C();
- (void) new C;
- When initializing bases and members, a constructor's mem-initializer-list may initialize a base class using any name that denotes that base class type (typedef); the name used may differ from the class definition. Example:
Listing: Example 2 - Unsupported Initialization Features
struct B {
int im;
B(int i=0) { im = i; }
};
typedef class B B2;
struct C : public B {
C(int i) : B2(i) {} ;
---------------------^------------------ERROR
};
- Specifying explicit initializers for arrays is not supported. Example:
Listing: Example 3 - Unsupported Initialization Features
typedef M MA[3];
struct S {
MA a;
S(int i) : a() {}
-----------------------^----------ERROR: Cannot specify explicit
initializer for arrays
};
- Initialization of local static class objects with constructor is unimplemented. Example:
Listing: Example 4 - Unsupported Initialization Features
struct S {
int a;
S(int aa) : a(aa) {}
};
static S s(10);
---------^-------------ERROR
See Conversion Features also.