Inserting object in to a map of map object

hi,
I am trying to insert an object in to a std::map object, in which I have
a std::vector object, where a std::vector constructor used as show in
the example statement (1) below

(1)

Code:

std::map< std::string, std::vector<int> > tryout;
tryout.insert(std::make_pair("k1",std::vector<int>(5)));


for which I am successful

however I am not getting the idea of how to similarly perform the
operation for the following std::map object, which has a std::map object as a value.

(2)

Code:

std::map< std::string, std::map<int, std::vector<int> > > intake;

I am able to insert the std::map object’s value by using the following
method

(3)

Code:

std::map< std::string, std::map<int, std::vector<int> > > intake;

std::map<int, std::vector<int> > temp;
temp.insert(std::make_pair(1, std::vector<int>(5)));
intake.insert(std::make_pair("k2", temp));


is there a method by using a constructor as in method part (1)
where I can similar insert values in std::map which is given in
part (2)?

View Complete Thread with Replies

No Reply.
Find related on my parent xResources.

Looking for something else? Search for it...

Tagged with: ,

No Replies

There are still no reply for this post.

Leave your reply...

If you want to leave your reply for this post, simply fill out the next form:




You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .


Powered by: Wordpress & 3G Creations