I am trying to make a configuration manager class, that can store arbitrary objects by std::string.
My starting idea for my interface (abstract base class) was this (of course this is horribly incomplete)
class ConfigurationManager
{
public:
static boost::shared_ptr<ConfigurationManager> create();
template<typename T>
virtual T getOption(const std::string& name) = 0;
};
But then my compiler pointed out that template's cannot be virtual(and then I realized that I cannot have exported templates anyways).
Internally I am going to be using boost::any's(pretty much a runtime checked void*), but I do not want to expose boost::any in my interface.
What would be the best way to go about this?