Inserting object in to a map of map object
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)
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)
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)
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.