0

Here is a small code example :

template <typename T>
class A
{
     //
}

class B
{
    friend class A<..>
}

In this case, I want A to be declared as a friend class but without specifying the template parameters...

SagiLow
  • 5,721
  • 9
  • 60
  • 115
  • 1
    Why not simply write a very basic scenario and check it out? :) – rbaleksandar May 04 '15 at 06:51
  • Not exactly a duplicate. That one asks how to do it, and the answer is "by specifying the parameters", but this one asks how to do it without the specifying the parameters, and the answer is probably "you don't". – Sergei Tachenov May 04 '15 at 06:51
  • @rbaleksandar Writing a basic scenario without knowing the syntax is a long shot, that's what the question is for.. – SagiLow May 04 '15 at 06:59
  • @SergeyTachenov: The answers there tell you how to declare a template as a friend. It doesn't specify the parameters, they're still "variable". Something like `friend class A;` would "specify" the template parameters as far as I understand the question. – Mat May 04 '15 at 07:13
  • @Mat you are correct, it is indeed a duplicate, I just think the headline on the other question makes it hard to find (and this is why I couldn't find it myself) – SagiLow May 04 '15 at 07:16
  • @Mat, ah, I see. I thought that the question was how to do it without even using the `template` keyword. My bad. – Sergei Tachenov May 04 '15 at 07:18

0 Answers0