2014年1月8日

C++友元模板类error C2433: "XXX" 不允许在数据声明中使用“friend”

摘要: #include #include using namespace std;////必须先声明,否则 友元模板类之间无法相互访问,出现未定义的错误!!template class B;template class A{public: int id; string name; void test(){}B * first; //使用B};template class B{friend A;public: int id; string name; }; #endif 阅读全文

posted @ 2014-01-08 15:17 justliver 阅读(1844) 评论(0) 推荐(0) 编辑

导航