BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / cpp / #39508同步于 2010/5/22
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖

CompileError求解

Famine
2010/5/22镜像同步4 回复
template <class T> class A{ public: int N; T data; }; template<class T> class B:public A<T>{ public: void foo(){ N = 1; } }; int main(){} Code::Blocks \test.cpp||In member function `void B<T>::foo()':| \test.cpp|17|error: `N' was not declared in this scope| ||=== Build finished: 1 errors, 0 warnings ===|
订阅后,新回复会通过你的通知中心匿名送达。
4 条回复
a206206机器人#1 · 2010/5/22
模板类做基类,要显式提供参数
greenMay机器人#2 · 2010/5/22
【 在 a206206 的大作中提到: 】 : 模板类做基类,要显式提供参数 : -- : 黑暗凝集灵魂,堕落方能自由 : ................... 膜拜ls两位大牛!
a206206机器人#3 · 2010/5/22
征哥。。。
sd4137838机器人#4 · 2010/5/24
我编译为何没错,vs2005