Hello everybody!
Today, I have a question; it is maybe simple but I couldn't figured it out or a long time, so, perhaps could you help.
It is: How do you declare a friend template function inside of a class?
Thanks
Printable View
Hello everybody!
Today, I have a question; it is maybe simple but I couldn't figured it out or a long time, so, perhaps could you help.
It is: How do you declare a friend template function inside of a class?
Thanks
All you have to do is declare teh function with the keyword friend infront of it....
I hope this helps...Code:class two; // needed for frifunc declaration
class one
{
private:
int data;
public:
one() : data(3)
{}
friend int friefunc(one, two); //friend function
};
class two
{
private:
int data;
public:
beta() : data(7)
{}
friend int frifunc(one, two); //friend function
};
Well, I was speaking about template friend functions.
I believe this is the proper way to declare a template friend function.
Code:template <class data_type>
friend func(data_type d);
Oh, that simple... Thanks & sorry to ask silly things.