samedi 14 mars 2015

Given a template argument, how to find out whether or not this is actually a parameterized template class?


Say I have the following code.



template <template <typename...> class C, typename T>
constexpr bool is_vector() {
return is_same<C<T>, vector<T>>::value;
}

template <typename Value, enable_if_t<is_vector<???>()>>
void my_function() {
}


How do I invoke is_vector in order to check if Value is a parametrized vector type?




Aucun commentaire:

Enregistrer un commentaire