Compiler fehler im Zuweisungsoperator!!



  • Zuweisungs:

    CWorklist o(....):

    CWorklist p=o;

    Folgender Code:

    CWorklist& CWorklist::operator=(const CWorklist &scr){
    
    	// wenn es keine Zuweisung an sich selbst ist
    	if(this != &scr){
    
    	// Inhalte löschen
    	for(int i=0; i<scr.acList.GetSize();i++)
    		scr.acList.ElementAt(i).acParts.RemoveAll();
    	scr.acList.RemoveAll();
    
    ......
    }
    

    Compiler fehler:

    c:\Dokumente und Einstellungen\bsw\Eigene Dateien\Visual Studio Projects\Simulator\Worklist.cpp(126): error C2662: 'CArray<TYPE,ARG_TYPE>::RemoveAll' : cannot convert 'this' pointer from 'const CArrayEx<TYPE,ARG_TYPE>' to 'CArray<TYPE,ARG_TYPE> &'
    with
    [
    TYPE=Part,
    ARG_TYPE=Part
    ]
    and
    [
    TYPE=Part,
    ARG_TYPE=Part
    ]
    and
    [
    TYPE=Part,
    ARG_TYPE=Part
    ]



  • ohh Sorry... ich bin blöd muss natürlich "scr" mit "This" erstetzen!!

    Ich Spam euch hier voll.... sorry


Anmelden zum Antworten