C++: Accessing specific value from single key-multiple value containers : So, it happens that I'm working on the task. So I was trying to implement a multi-value containers using C++ and to freely access each of the values inside. I have int key; values like X, Y, Width, Height as input.

I was trying to extract the values from each key.
But obviously, the code doesn't work in this case.

Would like some advice whether this can be done or any predefined container libraries with better flexibility in terms of accessing multiple values. 

tried with independent single-key, single-value 'multimap' containers, but it consume too much memory space and drag performance

    multimap<int, multimap <multimap<int, int>, multimap<int, int>>> BlobPos = {};
    //[<1,{(2,3),(4,5)}>,<2,{(6,7),(8,9)}>


    for (auto it = BlobPos.begin();it != BlobPos.end(); it++) { 
    auto X = it->second-> first->first;	
    auto Y = it->second->first->second;
    auto H = it->second->second->first;
    auto W =  it->second-second->second;

    cout << X << Y << H << W;

2 3 4 5
6 7 8 9