I am trying to insert an item, into a map, which holds two other map.
map< map<int, int> , map<int, int> > GC;
map<int, int> A;
A.insert(pair<int,int>(1,1));
map<int, int>:: iterator p1 = A.begin();
map<int, int> B;
B.insert(pair<int,int>(2,3));
map<int, int>:: iterator p2 = B.begin();
GC.insert( pair< map<int,int>, map<int,int> > (*p1, *p2) );
Well, as presumed its not working.
How to do it?
EDIT:
It gives the following error:
E:\CB\test.cpp|20|error: no matching function for call to
'std::pair<std::map<int, int, std::less<int>, std::allocator<std::pair<const int, int> > >, std::map<int, int, std::less<int>, std::allocator<std::pair<const int, int> > > >::pair(std::pair<const int, int>&, std::pair<const int, int>&)'
I am not sure what are trying to achieve here …..
Your key and value needs to be an map object in order to work…
In that case only possibility is