#include <iostream>
using namespace std;

class B {
public:
    B() {
    	// complex initializations
    };
    virtual int doSomething()
    {return 2 * doSomethingHelper();}

  protected:
    class initialiser {
    public: 
        initialiser(B*b) {b->init();}
    };
    void init() {  //  the rest of the what you wanted in constructor 
      int a = doSomething();
      // more complex stuff with `a`
    }
    virtual int doSomethingHelper() = 0;
};


class C:  public  B {
public: 
 protected:
    B::initialiser bi{this}; // this truggers automaticcaly the second phase
    virtual int doSomethingHelper()
    {cout <<"OK"<<endl; return 1;}
};

int main() {
  C c;
  return 0;
}
