Reputation: 53
I've the below code,
template< typename T >
class T1 {
public:
T i;
protected:
T j;
private:
T k;
friend void Test();
};
The above code has a template class T1 with three members i,j and k and a friend function Test(),
I just want to know that which member/s of T1 will be available in function Test()?
Any help in this regard will be highly appreciated.
Upvotes: 0
Views: 362
Reputation: 16994
All of them (i, j, k) will be available in function Test().
This is what "friend" gives you access to.
Upvotes: 4
Reputation: 24685
Everyone. If it's friend it's friend for good and bad.
Upvotes: 0
Reputation: 92874
I just want to know that which member/s of T1 will be available in function Test()?
Upvotes: 3