Good morning, I have a problem when dealing with the map stl library, and It would be great if anyone could help me solve it.
I have this code:
1 2 3 4 5 6 7
typedef person* key_person;
typedef std::map< person*, int > friends; //map named " friends" which contains a person and an int.
typedef std::map<key_person,friends> graph_data; //map that contains a key_person and another map.
Where person is a class.
And then Lets say that I wanna add to "data" a person object name lucy, but without any map friends, I just wanna add lucy to the "data" map , just the person and not another map, remember that data is like this: map<key_person,friends> where friends is another map.
person* lucy=new person();
But Im getting an error: error: no matching function for call to 'std::map<person*, std::map<person*, int> >::insert(person*)'|
I dont wanna add any map friends yet, but i will.
I would really appreciate any given help!