vendredi 25 novembre 2016

no match for 'operator==' (operand types are 'std::string {aka std::basic_string

I have the following problem that i can't solve. I hope some of you guys can help me.

    list<Butor*> names_list;

    for(list<Butor>::iterator it=butorok.begin();it!=butorok.end();it++)
    {
        if(new_product_name1==it->getUb_name1() && new_product_name2==it->getUb_name2())
        {
            names_list.push_back(it->Clone());
        }
    }
    cout<<"Pls type in the color of the product: ";
    cin>>color;
    int i=0;
    list<Butor*>::iterator index;
    for(list<Butor*>::iterator it=names_list.begin();it!=names_list.end();it++)
    {
       if(color==(*it)->getUb_szin)
        {
            i++;
        }
    }

The problem is here --> if(color==(*it)->getUb_szin) getUb_szin is a simple getter function and the Clone fuction is making a Clone of a "Butor" object

Aucun commentaire:

Enregistrer un commentaire