Your problem is not in map, keys, or iteration. It is in printing tuple:
1 2 3 4 5 6 7 8 9
// my first program in C++
#include <iostream>
#include <tuple>
int main()
{
std::tuple<int,int,int,int> example {1,3,2,0};
std::cout << example; // error
}
The use of appropriate const correctness is recommended within a whole section of the Guidelines titled 'Con: Constants and immutability'. Guideline Con.1 recommends making objects constant by default if the value of the object is immutable (see https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rconst-immutable ).