下列函数模板声明中,合法的是

admin2021-02-22  18

问题 下列函数模板声明中,合法的是

选项 A、templateTabs(Tx);
B、templateclassTabs(Tx);
C、templateTabs(Tx);
D、template<>Tabs(Tx);

答案A

解析 选项B中类型形参T前需要有关键字class或typename修饰;选项C中函数ads需要返回值;选项D中形参表不能为空;答案为A。
转载请注明原文地址:https://kaotiyun.com/show/ohfp777K
0

相关试题推荐
随机试题
最新回复(0)