0

I want to provide a static assert that checks whether all the elements of a parameter pack are of some type T.

The client code looks like:

template <typename... Args>
void foo(Args... args)
{
    static_assert(are_all_of_the_type<int, Args...>::value);
}

Any ideas on how to implement the type trait are_all_of_the_type?

A very alike question was addressed here, yet I don't see how to use the proposed solution with a parameter pack.

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
Nestor
  • 687
  • 5
  • 12

0 Answers0