...就我而言:
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类的朋友?
您可以在朋友声明中正常使用typedef(自C ++ 11起:Documentation