I can easily create template class that is friend with generic T
class:
template <typename T>
class Secret {
private:
friend T;
Secret() {}
};
I would like to do the same, but with variadic template arguments. I want MultiSecret
to be friend with each type in Ts
. Is it possible to do? How can I unpack Ts
?
template <typename... Ts>
class MultiSecret {
private:
// How to unpack Ts?
MultiSecret() {}
};
EDIT. Secret
and MultiSecret
classes have private constructors. I want to allow only Ts
to be able to create MultiSecret
.