samedi 1 août 2015

Pass a parameter pack to another parameter packed function

I am trying to call a function with this signature:

template <class Component, class ... Args>
void addComponent(const Entity & ent, Args&& ... args){

Using this function:

template <class Component, class ... Args>
void Entity::add(Args&& ... args){
    manager->addComponent<Component>(*this, std::forward<Args>(args)...);
}

However, VS2015 is complaining that it is "unable to match function definition to an existing declaration". What is the problem here?

Aucun commentaire:

Enregistrer un commentaire