TITLE: Example of bad assumptions in initialization ordering PROBLEM: admin@rzaix13.uni-hamburg.de (Bernd Eggink) class X { }; class A { A(X &x); }; class B: public A { B(): A(*(px = new X)) { } X *px; }; [...] RESPONSE: clamage@taumet.Eng.Sun.COM (Steve Clamage) Although you probably understand it, not everyone gets the difference between initialization and assignment, which in C++ is quite important. Initialization is giving a value to a newly-created object at the time of its creation. Assignment is giving a possibly new value to an object which already exists. You are ASSIGNING to a derived class member before the derived class has been created. That is the logical contradiction. The rules for object construction are in this sequence (some details omitted): - initialize all base classes (via their constructors) - initialize all members of the current class (via member init or ctor) - execute the constructor body. ASSIGNMENT to members of the current class cannot take place until the third step. You are trying to perform step 3 before step 1 has taken place. I don't believe the compiler is required to make space for the derived portion of the object until the base classes have been initialized, for one example. (I don't know of any implementations like this, but I can think of a plausible one.) For another example, supposed the derived-class member were not a simple pointer, but an object with a constructor and destructor. You would be assigning to an object which would later have its constructor invoked. Worse, assignment might be performed with a user-written op= which first destroyed the left-hand side. The destructor would be invoked on an object which had not been constructed (e.g., it might try to delete storage via an uninitialized pointer, close a file via an uninitialized file object, unlock an uninitialized semaphore, etc). As I said, pretzel logic. (I like pretzels for eating, but not as a logic model.)