作者popo4231 (小泰)
看板EE_DSnP
標題[問題] 怎麼樣把單一的class member function弄成別人的friend?
時間Sat Dec 8 23:01:31 2007
is this ok?
class A
{
public:
void x()
{
}
};
class B
{
friend void A::x();
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.241.177
1F:推 ric2k1:Yes, friendship is granted, not taken. 12/08 23:47
2F:→ ric2k1:so you are correct. Now A::x() can access B's private 12/08 23:48
3F:推 ric2k1:data members and member functions. 12/08 23:48
4F:→ ric2k1:We will cover this in next lecture too. 12/08 23:49