嗨,我在使用 g++ 4.1.2 编译时遇到此错误
“错误:operator= in 不匹配” ((PoolElementList*)this)->PoolElementList::i_currentElement = ((PoolElementList*)this)->PoolElementList::i_elementList.std::vector<_Tp, _Alloc>::end _Tp = ModifyTerminationPointReqInfo*, _Alloc = std::allocator
PoolElements 的定义如下:
template <class Element, Element *intialElementPtr>
class PoolElementList
{
GenericMemoryPool <Element, intialElementPtr> *i_elementPoolPtr;
vector <Element *> i_elementList;
vector <Element *> i_currentElement;
public:
//Define a constructor that takes in a pointer of the pool.
PoolElementList(GenericMemoryPool <Element, intialElementPtr> *elementPool):
i_elementPoolPtr (elementPool)
{
i_currentElement = i_elementList.end(); //error is here**
};
请有人可以解释这可能有什么问题。(这是在 g++ 2.9.x 中编译的)