I\'m trying to create a structure array which links input strings to classes as follows:
struct {string command; CommandPath cPath;} cPathLookup[] = {
{\
Personally I don't see it as being a huge problem if you just have 1 factory for creating different "CommandPaths" for different values of the string it receives. Anyway, your code won't work because you can't store types the way you're trying.
If I had to do this, then for one I would use function pointers to factory functions and use a std::map to map strings to these, like shown in this code, and maybe wrap the pointers in an appropriate smart-pointer, instead of using raw pointers:
#include
#include
As for your question about pointers and abstract classes, you can have a pointer to an abstract class, but you can't instantiate an abstract class.