Вы хотите (is_string_or_int(param_0)) && (is_string_or_int(param_1)) && (is_string_or_int(param_2)) && ...
. Это можно записать с помощью выражения свертки:
typename std::enable_if<
(true && ... && (
std::is_same<ParamType, std::string>::value ||
std::is_same<ParamType, int>::value
))
>::type
Это работает только с C ++ 17 и выше. Для дружественного к C ++ 11 решения вы можете go для структурных специализаций для перебора типов:
// true iff Testing is any of Required...
template<typename Testing, typename... Required>
struct one_match : std::false_type {};
template<typename Testing, typename First, typename... Rest>
struct one_match<Testing, First, Rest...> : std::bool_constant<std::is_same<Testing, First>::value || one_match<Testing, Rest...>::value> {};
// true iff all of TestingTypes... are in the tuple RequiredTypesTuple
template<typename RequiredTypesTuple, typename... TestingTypes>
struct all_match;
template<typename... RequiredTypes>
struct all_match<std::tuple<RequiredTypes...>> : std::true_type {};
template<typename... RequiredTypes, typename First, typename... Rest>
struct all_match<std::tuple<RequiredTypes...>, First, Rest...> : std::bool_constant<one_match<First, RequiredTypes...>::value && all_match<std::tuple<RequiredTypes...>, Rest...>::value> {};
template <typename... ParamType, typename enabler =
typename std::enable_if<
all_match<std::tuple<std::string, int>, ParamType...>::value
>::type>
static inline void Log(const ParamType & ... args)
{
}