There\'s this one thing in C++ which has been making me feel uncomfortable for quite a long time, because I honestly don\'t know how to do it, even though it sounds simple:<
extern std::pair const factories[2]; decltype(factories) factories{ {"blah", []() -> Base*{return new Blah;}}, {"foo", []() -> Base*{return new Foo;}} };