I'm getting the following error trying to declare an std::function pointing to a templated class member.
Error C2672 '
std::invoke': no matching overloaded function found
template <typename InputArchive, typename OutputArchive, typename ... Components>
class LevelSerializer {
...
template <typename Component>
void initRegistry() {
...
std::function<void(entityx::Entity, OutputArchive)> f(std::bind(&LevelSerializer<InputArchive, OutputArchive, Components...>::saveComponent<Component>, this)); // errors
}
...
// I'm trying to point to an instance of this function
template <typename T>
void saveComponent(entityx::Entity& entity, OutputArchive& archive)
};
entityx::Entity is a fixed (non-template) type. Why does doing this fail?
Aucun commentaire:
Enregistrer un commentaire