class Peer;//错误的做法,不能使用向前声明,必须是用include 包含Peer的头文件,否则回调函数中的this指针无效 typedef void (Peer::*PeerOnMsgFunc)(MsgHead*);