dimanche 28 décembre 2014

Why is this variadic function call ambiguous?


template<typename FilterComponent, typename ...FilterComponents>
std::bitset<components_count> component_impl(std::bitset<components_count> &b){
b.set(FilterComponent::get_id());
return component_impl<FilterComponents...>(b); //ambiguous
}
template<typename FilterComponent>
std::bitset<components_count> component_impl(std::bitset<components_count> &b){
b.set(FilterComponent::get_id());
return b;
}
template<typename ...FilterComponents>
std::bitset<components_count> component_mask(){
std::bitset<components_count> b;
component_impl<FilterComponents...>(b);
return b;
}


Why is this function call ambiguous? I wanted to call it like component_mask<Foo,Bar,Baz>();



error: call to member function 'component_impl' is ambiguous
return component_impl<FilterComponents...>(b);

Aucun commentaire:

Enregistrer un commentaire