I'm somewhat new to the concept. It's a feature of C++ I've been avoiding for a _long_ time for reasons less than good (other than the constant vtable overhead slander). I wanted to use pure virtual classes to hold a plugin interface. However, I'm rather confused as to how to make a decent plugin. Observe the following code:
There are some problems with this obviously. I was also rather confused as to the benefits of a factory over something like this as I was told it would be most beneficial (nor do I see how it would work for a plugin system). Am I taking a wrong approach? Could I get advice on how to go about this?
EDIT: Sorry for the poor example. It was meant to be basic. Also, to compile, it requires a C++11 capable compiler. Should compile with VC++, GCC (with --std=gnu++0x), clang.