I've got a class template with a template template parameter, and I want to declare this parameter (that is, all of its specializations) as a friend
. But I can't find the correct syntax.
template <template <class> class T>
struct Foo {
template <class U>
friend T; // "C++ requires a type specifier for all declarations"
template <class U>
friend struct T; // "declaration of 'T' shadows template parameter"
template <class U>
friend struct T<U>; // "cannot specialize a template template parameter"
pretty<please>
lets(be) friends T; // Compiler shook its standard output in pity
};
How can I declare a template template parameter as friend
?