#include <iostream>
#include <type_traits>
template <typename TargetT, typename ... Ts>
struct is_type_in_pack;
template <typename TargetT, typename Tt, typename ... Ts>
struct is_type_in_pack<TargetT, Tt, Ts...>
{
static constexpr bool value = std::is_same_v<TargetT, Tt> || is_type_in_pack<TargetT, Ts ...>::value;
};
template <typename TargetT, typename Tt>
struct is_type_in_pack<TargetT, Tt>
{
static constexpr bool value = std::is_same_v<TargetT, Tt>;
};
template<typename TargetT, typename ... Ts>
constexpr bool is_type_in_pack_v = is_type_in_pack<TargetT, Ts...>::value;
int main()
{
// 判断 double 是否在之后参数列表 [char, signed short, double, char, long] 中
static_assert(is_type_in_pack_v<double, char, signed short, double, char, long>);
std::cout << " === test end === " << std::endl;
}