Original Post
Here is my Error:
Quote:Here is what I'm using for the code:
.\D3DGUI.cpp(160) : error C2664: 'std::_Vector_iterator<_Ty,_Alloc> std::vector<_Ty>::erase(std::_Vector_iterator<_Ty,_Alloc>)' : cannot convert parameter 1 from 'CForm **' to 'std::_Vector_iterator<_Ty,_Alloc>' with [ _Ty=CForm *, _Alloc=std::allocator<CForm *> ] No constructor could take the source type, or constructor overload resolution was ambiguous
Quote:And here is the definition of erase
m_vFormList.erase(&m_vFormList);
Quote:notice, thats defined in vectors.h! and here is my m_vFormList
iterator erase(iterator _Where) { // erase element at where _STDEXT unchecked_copy(_VEC_ITER_BASE(_Where) + 1, _Mylast, _VEC_ITER_BASE(_Where)); _Destroy(_Mylast - 1, _Mylast); --_Mylast; return (_Where); }
Quote:and here is my CForm class:
std::vector<CForm*> m_vFormList;
Quote:Does anyone here know why I am getting this error? This is being used in my D3D Project (if you were wondering how this related to D3D).
class CForm { public: CForm(){} ~CForm(){} //pure methods virtual void Initialize() = 0; //accessors virtual const rect_s &GetRect() const; virtual const bool IsSelected(CFormObject *pObject) const; //methods virtual void Render(BYTE alpha); virtual void Move(int offsetx, int offsety); virtual void MouseClick(int mousex, int mousey, bool isDoubleClick = false); virtual void InputCharacter(char c); virtual CFormObject *AddControl(CFormObject *pObject); protected: std::vector<CFormObject*> m_vObjectList; rect_s m_Rect; char m_szTitle[TITLEBAR_LENGTH+1]; CFormObject *m_pSelected; };