返回信息流#include<iostream>
using namespace std;
template <typename T>
class Base
{
friend T;
public:
Base() {}
~Base() {}
};
class test : virtual public Base<test>
{
public:
test() {}
~test() {}
};
void main()
{
test p;
}
t1.cpp:6:5: error: a class-key must be used when declaring a friend
t1.cpp:6:5: error: friend declaration does not name a class or function
这是一条镜像帖。来源:北邮人论坛 / cpp / #76958同步于 2014/2/16
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖
[问题]error: a class-key must be used when declaring a frie
century
2014/2/16镜像同步2 回复
订阅后,新回复会通过你的通知中心匿名送达。