I got a plain variadic template declaration, just like the classic one:
template
class VariadicTemplate;
What
Here there is anothe solution :P
Here it is:
template struct static_all_of;
// do recursion if the first argument is true
template
struct static_all_of : static_all_of {};
// end recursion if first argument is false
template
struct static_all_of : std::false_type {};
// end recursion if no more arguments need to be processed
template <> struct static_all_of<> : std::true_type {};
// First template argument is given as the type checking for the is_base_of() function
template
class CollectionOfCommonBase : public Requirements...
{
static_assert(static_all_of::value...>::value, "One or more template arguments are not base_of the one specified - given template specialization is not allowed.");
};
So you got it working for:
class Foo {};
class AFoo : public Foo {};
class BFoo : public Foo {};
class MyCollection : public CollectionOfCommonBase {};