This is somewhat similar to this problem 4d mapping in C++? and one of my previous questions on maps in C++ Use a map with the map name defined by a string C++
I have a code that looks like this (that does not work and stops at the line giving input to the map):
#include <iostream>
#include <string>
#include <tuple>
#include <map>
#include <vector>
using namespace std;
int main()
{
map<string, //Volkswagen (car brand)
map<string, //series
map<int, //in this example 1
tuple<string, string>>>> mapMapMap;
string myCarmapMapMap = "Volkswagen";
int Number = 1;
mapMapMap[myCarmapMapMap]["3 series"][Number] = {90, 20};,
string Output;
Output.assign(get<0>(mapMapMap[myCarmapMapMap].find("3 series")->second));
cout << "\n" << "------------" << "\n" << Output << "\n"<< "------------" << "\n";
}
What I want to do is to assign two values to Volkswagen
, 3 series
, 1
and then be able to call it like:
Volkswagen -> 3 series -> 1 -> <0> (value 1).
This is the error message I get:
|19|error: expected primary-expression before ',' token|
I have also tried:
mapMapMap.insert({myCarmapMapMap, "3 series", Number, {"90", "20"}});
But it does not work either. How do I combine a 4d map with a tuple?