[Solved] How to self register class instances using the CRTP?

I decided to reopen the question and self answer based on Yakk’s fixes. Seems to be a more common problem (see here for example) Yakk’s example solved it: #include <cstdint> enum class CommandId : uint16_t { Command1 , Command2 , }; #include <map> #include <functional> #include <string> //#include “CommandId.h” class Registry { public: static std::map<CommandId,std::function<void … Read more