c++11 - How to initialize a nested map in constructor initialization list in c++ -


class test{    public:       test();    ...    private:       map<int, string> map1;       map<int, map<int, string>> map2; //two dimensional map    ... };  test::test():map1() {} 

i trying initialise map using initialization list. simple(single) map, can initialize call map constructor(map1()) in initialization list. how can initialize nested map(map2) in constructor initialization list.

thanks in advance help.


Comments

Popular posts from this blog

javascript - How to bind ViewModel Store to View? -

recursion - Can every recursive algorithm be improved with dynamic programming? -

c - Why does alarm() cause fgets() to stop waiting? -