int main (int argc, char* argv[]) { Impl impl; Global& global = impl; A& a = impl; B& b = impl; impl.A1(); impl.B1(); impl.AB1(); impl.AB2(); impl.AB3(); std::cout << std::endl; a.A1(); b.B1(); std::cout << std::endl; a.AB1(); a.AB2(); a.AB3(); std::cout << std::endl; b.AB1(); b.AB2(); b.AB3(); std::cout << std::endl; global.A1(); global.B1(); global.AB1(); global.AB2(); // global.AB3(); // Does not compile return 0; }