does this make sense as a way to uniquely identify objects and create them on demand? I want to have this 'registerDerived' option because I want to have a set of default objects pre-registered and then let additional ones be created and registered, all at compile time but I can't figure out how to do this registering at compile time so it's runtime
the map & reverse map at the end are just so a list of identifiers can be displayed and then fed back in to create the correct object
struct Base {
virtual ~Base() = default;
};
struct A : Base {
static std::unique_ptr<Base> create() {
return std::make_unique<A>();
}
};
struct B : Base {
static std::unique_ptr<Base> create() {
Comment too long. Click here to view the full text.