According to the C++ Standard
If a mem-initializer-id designates the constructor’s class, it shall be the only mem-initializer; the constructor is a delegating constructor, and the constructor selected by the mem-initializer is the target constructor. The principal constructor is the first constructor invoked in the construction of an object (that is, not a target constructor for that object’s construction). The target constructor is selected by overload resolution. Once the target constructor returns, the body of the delegating constructor is executed. If a constructor delegates to itself directly or indirectly, the program is ill-formed; no diagnostic is required.
So this constructor definition
MyClass::MyClass(int a, int b)
:
MyClass(a, b, NULL),
int1(a),
int2(b),
pOtherClass(NULL)
{
}
is invalid.
Must be
MyClass::MyClass(int a, int b)
:
MyClass(a, b, NULL)
{
}