file Base.h
class Base {
}
file A.h
class A : public Base {
}
file B.h
class B : public Base {
}
file C.h
#define D_CLASS A
file C.cpp
#include "c.h"
#include D_CLASS##.h // <--- how to make the header from class name?
Base * pBase = new D_CLASS() ;
The incentive in doing this...
System that support different operating systems, each OS has header file that tell the builder the name of class to create in order to provide certain functionality.
when user adds it's new OS he needs also to define his specific class name with that functionality.