很初级的 ACE迭代器类型定义问题
定义一个vector iteratorvector<int>::iterator iter;
没问题,在ACE中类似定义一个iterator :
ACE_Hash_Map_Manager<int,int, ACE_Null_Mutex>::iterator iter;
则无法通过编译,找了很久没找到问题。:dizzy: 又找到问题了
实事上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) {}
...
} 唉,真有点沮丧,ACE方面的资料太少了,碰到点P大的问题最终都只能靠自己啃源码解决,真碰上赶项目的就死定了。 这类玩意就用STD/SGI的. 这类玩意就用STD/SGI的. 这类玩意就用STD/SGI的.
页:
[1]