I\'ve heard somewhere, that using new C++1z syntax, it is really easy to check if a type is passed in variadic template parameter pack - apparently you can do this with code
If you are bound to C++11 you cannot use std::disjunction nor fold-expressions. However, it is rather straightforward to roll your own any_is_same:
template
struct any_is_same {
static const bool value = std::is_same::value ||
any_is_same::value;
};
template
struct any_is_same : std::is_same {};
int main(){
std::cout << any_is_same::value << "\n";
std::cout << any_is_same::value << "\n";
}
Live Demo