问题
单项选择题
类模板template<class T>class x...,其中,友元函数f对特定类型T(如int),使函数 f(x<int>);成为x<int>模板类的友元,则其说明为( )。
A.friend void f();
B.friend void f(x<T>);
C.friend void A:: f()
D.friend void C<D:: f(x<T>);
答案
参考答案:B
类模板template<class T>class x...,其中,友元函数f对特定类型T(如int),使函数 f(x<int>);成为x<int>模板类的友元,则其说明为( )。
A.friend void f();
B.friend void f(x<T>);
C.friend void A:: f()
D.friend void C<D:: f(x<T>);
参考答案:B