/// illustrating http://stackoverflow.com/a/99622/2932052 (variation)
/// under discussion in http://stackoverflow.com/q/30780171/2932052
#include <iostream>
using namespace std;

class A
{
    int id;
public:
    A(int i): id(i) {}
    int callFoo() { return foo(); }
    virtual int foo() = 0;
};

class B: public A
{
public:
    B(): A(callFoo()) {}
    int foo() { return 3; }
};

int main() {
	B b;
	cout << b.callFoo() << endl;
	return 0;
}