找回密码
 用户注册

QQ登录

只需一步,快速开始

查看: 3757|回复: 5

很初级的 ACE迭代器类型定义问题

[复制链接]
发表于 2011-3-24 18:28:11 | 显示全部楼层 |阅读模式
定义一个vector iterator

vector<int>::iterator iter;

没问题,在ACE中类似定义一个iterator :

ACE_Hash_Map_Manager<int,int, ACE_Null_Mutex>::iterator iter;
则无法通过编译,找了很久没找到问题。:dizzy:
 楼主| 发表于 2011-3-24 19:31:45 | 显示全部楼层
又找到问题了
实事上iterator 实现于底层ACE_Hash_Map_Iterator_Ex,
而ACE_Hash_Map_Iterator_Ex又继承自 ACE_Hash_Map_Iterator_Base_Ex,
操蛋的是 他们都没有实现空构造函数,所以上边定义报错,分别加上后运行正常.


顺便又看了了一下STL List iterator的实现

template<class T, class Ref, class Ptr>
struct __list_iterator {
....
  // 三种构造函数
  __list_iterator(link_type x) : node(x) {}
  __list_iterator() {}
  __list_iterator(const iterator& x) : node(x.node) {}
...
}
 楼主| 发表于 2011-3-24 19:40:15 | 显示全部楼层
唉,真有点沮丧,ACE方面的资料太少了,碰到点P大的问题最终都只能靠自己啃源码解决,真碰上赶项目的就死定了。
发表于 2011-3-31 01:46:34 | 显示全部楼层
这类玩意就用STD/SGI的.
发表于 2011-3-31 01:46:43 | 显示全部楼层
这类玩意就用STD/SGI的.
发表于 2011-3-31 01:46:51 | 显示全部楼层
这类玩意就用STD/SGI的.
您需要登录后才可以回帖 登录 | 用户注册

本版积分规则

Archiver|手机版|小黑屋|ACE Developer ( 京ICP备06055248号 )

GMT+8, 2024-5-17 09:57 , Processed in 0.011877 second(s), 6 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表