|
-
November 26th, 2015, 07:24 AM
#1
stl nested maps
I have put some kind of pseudocode for the issue I am facing
I have a hybrid map, I want to insert a particular element from this map to another map.
typedef std::map<int,int> MapOfInts;
typedef std::map<int,MapOfInts> HybridMapOfInts;
Code:
int main ()
{
MapOfInts mymap;
MapOfInts mylatmap;
HybridMapOfInts myNewmap;
MapOfInts::iterator it;
HybridMapOfInts::iterator itNew;
mymap[5]=50;
mylatmap[1]=10;
mylatmap[2]=20;
myNewmap.insert(std::make_pair(1, mylatmap) );
itNew = myNewmap.find(1);
//Following gives error, is there any efficient simple right way to do this ??
mymap.insert(itNew->second);
}
Last line gives error , is there any efficient simple right way to do this ??
Last edited by pdk5; November 26th, 2015 at 12:12 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|