...就我而言:
template<class X>
struct _Command {
char* id;
char* description;
char messages[10][100];
bool (X::*function)();
};
Class Server {
public:
typedef _Command<Server>Command;
}
如何使Command成为Server类的朋友?
答案 0 :(得分:0)
您可以在好友声明中正常使用typedef:
class Server {
public:
typedef _Command<Server> Command;
friend Command;
};