I have a typedef, a class with a member vector using that type and then a method using std::<vector>::erase().
#typedef DWORD WordNo_t;
class CWordList : public CObject
{
public:
WordNo_t* begin() { return m_Words.begin(); }
WordNo_t* end() { return m_Words.end(); }
void truncate (WordNo_t *Ptr)
{
if (Ptr == end())
return;
ASSERT (Ptr >= begin() && Ptr < end());
// following line generates C2664
m_Words.erase (Ptr, end());
}
private:
std:vector<WordNo_t> m_Words;
}
The detailed error is:
error C2664: 'std::_Vector_iterator<_Myvec> std::vector<_Ty>::erase(std::_Vector_const_iterator<_Myvec>,std::_Vector_const_iterator<_Myvec>)' : cannot convert parameter 1 from 'const WordNo_t' to 'std::_Vector_const_iterator<_Myvec>'
Pretty new to STL... Any help would be appreciated.