ペアで作業するのはこれが初めてで、完全に混乱しています。マップに挿入するようにペアを初期化する方法は?
これには標準ライブラリを含める必要がありますか?
#include <string>
#include <map>
using namespace std;
class Roads
{
public:
map< pair<string,string>, int > Road_map;
void AddRoad( string s, string d )
{ int b = 2 ; Road_map.insert( pair<s,d>, b) ; } //pair<s,d> is wrong here.
};