std::string description;
creator_base(const std::string& descr): description(descr) { }
creator_base(const char* descr): description(descr) { }
+ virtual ~creator_base() { }
virtual Base* operator()() const = 0;
};
if (it != assoc.end())
return (*it->second)();
else
- return NULL;
- }
-
- Base* new_instance(const char* name) const
- {
- return new_instance(std::string(name));
+ return nullptr;
}
const std::string& get_name(iterator& it) const { return it->first; }
std::string description;
creator_base(const std::string& descr): description(descr) { }
creator_base(const char* descr): description(descr) { }
+ virtual ~creator_base() { }
virtual Base* operator()(Arg1, Arg2) const = 0;
};
if (it != assoc.end())
return (*it->second)(arg1, arg2);
else
- return NULL;
- }
-
- Base* new_instance(const char* name, Arg1 arg1, Arg2 arg2) const
- {
- return new_instance(std::string(name), arg1, arg2);
+ return nullptr;
}
const std::string& get_name(iterator& it) const { return it->first; }