注册 | 登录 | 设为首页 | 加入收藏
您当前的位置:飞翔学院-IT中国 → 编程开发C/C++ → 文章内容

VC++8.0 (VC++ 2005 Express)

作者:佚名 来源:本站整理 发布时间:2008-5-23 15:29:48

//below the code can be compiled ok in vc++8.0
#include"map"
#include<iostream>
using namespace std;
typedef struct {
long id;
char name[10];
} eleT;

struct lessval {
bool operator() (const eleT& s1, const eleT& s2) const {
return (s1.id < s2.id);
}
};
?
int main() {
_Tree< _Tmap_traits<eleT, eleT, lessval, std::allocator<eleT>, false> >
rb( lessval(), std::allocator<eleT>() );
//int sz=rb.size();
}
// but if I uncomment the line int sz=rb.size(), then I get the following error //message: left of '.size' must have class/struct/union . what was it ? how //does it be fixed ? thanks a lot.


  • 打印文档
  • 推荐好友
  • 返回顶部
  • 增大字体
  • 减少字体

热点文章

关于本站 | 工作机会 | 合作网站 | 广告服务 | 市场合作| 联系我们 | 抽奖活动
版权所有: 武汉威俊科技有限公司 Copyright 2005-2007 www.ITCNW.COM All rights reserved