Imagine we have this code:
template <class, class> class Element {}; template <class T> class Util { public: template <class U> using BeFriend = Element<T, U>; };
Can I mark BeFriend as a friend? (Of Util or any other class).
Edit
The "obvious" syntax was analyzed, but both refused with Clang 3.6.
template <class> friend class BeFriend; template <class> friend BeFriend;
I did not know about the second syntax, but found it in this answer . It seems to work (and require) for non- template aliases, but does not help in this case when the template is smoothed.
(Please note: since some of them can deduce from a minimal example, Iโm looking for a way around a limitation that C ++ does not allow to be friends with a partial specialized specialization)
c ++ c ++ 11 friend templates
Ad n
source share