samedi 26 décembre 2015

error C2679: binary '=' : no operator found which takes a right-hand operand of type 'std::basic_string

hi i have tried to write a phonebook c++ code with unorderd_map but i'am facing a problem in the begining of this code there is an error whice i can't understand it when i tried to run it i've got this error "Error 1 error C2679: binary '='" can anyone please help me

#include <iostream>
#include <string>
#include <unordered_map>
#include <vector>
#include <hash_map>
#include <algorithm>
using namespace std;

int main()
{
unordered_map<string, pair< string,vector<string>>>contact;
string name, number, address;
cin >> name >> number>>address;
contact[name]=make_pair(number, address);
unordered_map<string, pair< string, vector<string>>> ::iterator it;
it = contact.begin();
while (it != contact.end())
{
    cout << it->first;
    it++;
}
return 0;
}

Aucun commentaire:

Enregistrer un commentaire