I am afraid this is not possible because template packages are bulky. However, you can pack the packages.
We adapt the verification check:
template <typename T, typename... Other> struct RefCheck { static const bool value = std::is_reference<T>::value || RefCheck<Other...>::value; }; template <typename T> struct RefCheck<T> { static const bool value = std::is_reference<T>::value; }; template <typename... Args> struct RefCheck<Pack<Args...>>: RefCheck<Args...> {};
And now we can use Pack :
template <typename P, bool = RefCheck<P>::value> class NoRef; template <typename... Args> class NoRef<Pack<Args...>, false> {
source share