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
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);
While you're breakin' down my back n'
I been rackin' out my brain
It don't matter how we make it
'Cause it always ends the same
You can push it for more mileage
But your flaps r' wearin' thin
And I could sleep on it 'til mornin'
But this nightmare never ends
Don't forget to call my lawyers
With ridiculous demands
An you can take the pity so far
But it's more than I can stand
'Cause this couchtrip's gettin' older
Tell me how long has it been
'Cause 5 years is forever
An you haven't grown up yet
-- You Could Be Mine - Guns N' Roses
Oh, that simple... Thanks & sorry to ask silly things.