| 发表于:2007-02-13 14:06:18 楼主 |
封装一个类模板类,其中有个成员是std::map template <class key,class value> class cmymap { public: ... void* lookup(key key); std::map <key,value> mocontent; ... } template <class key,class value> inline void* cmymap <key,value> ::lookup(key key) { bool lbresult = false; cautolock moautolock(mstraccesscritcalsection); //这一行会报错 std::map <key,value> ::iterator locontentiterator; locontentiterator = mocontent.find(key); if(locontentiterator == mocontent.end()) 。。。。 } 在linux下编译会提示error: expected `; ' before "locontentiterator "。 不知道是什么原因,如何解决。整了两天了,请高手指点。 |
|
|
|
|