请大家用vc2008编译下面代码,会弹出一个错误,我怀疑上vc编译器第一个bug。
#include <vector>
#include <queue>
template<class _Ty>
class CAddingVector
{
private:
typedef std::vector<_Ty*> CEleTypeVec;
CEleTypeVec m_EleVector;
public:
CAddingVector::CAddingVector(){}
CAddingVector::~CAddingVector(void){}
inline const _Ty* CAddingVector::operator[](int nPos) const
{
ASSERT(nPos < m_EleVector.size());
CEleTypeVec::reference ref = m_EleVector.at(nPos);
return ref;
}
inline _Ty* CAddingVector::operator[](int nPos) const
{
ASSERT(nPos < m_EleVector.size());
CEleTypeVec::reference ref = m_EleVector.at(nPos);
return ref;
}
};
本文转自jetyi51CTO博客,原文链接: http://blog.51cto.com/jetyi/407951,如需转载请自行联系原作者