Jak moge zrobić słownik z trzema typami zmiennych? Musi być on dostępny w całym programie. Próbowałem coś takiego:
#include <iostream>
#include <map>
#include <utility>
#include <string>
using namespace std;
map<pair<int, string>, int> mapa;
void show()
{
mapa.insert(make_pair(434543, "tekst"), 54656);
cout << mapa.first;
}
int main()
{
show()
return 0;
}
ale wyskakuje mi błąd
error: no matching function for call to 'std::map<std::pair<int, std::__cxx11::basic_string<char> >, int>::insert(std::pair<int, const char*>, int)' mapa.insert(make_pair(434543, "tekst"), 54656);