In registerClass, you can't use operator[] because in case the provided key doesn't exist in the map, a default constructed reference_wrapper should be instantiated. However, this is not possible since it makes no sense to create an object supposed to encapsulate a reference without any reference.
On the other hand, you could first test the existence of the key with find and then insert the new entry if needed:
if (getRegistry().find(id) == getRegistry().end())
{
getRegistry().insert ({id,std::ref(ds)});
}
or you can simply as @AhmedAEK suggested use emplace.