initializer_list for Vector Vs initializer_list for Map
Hi Please refer below code: https://code.sololearn.com/c7A17a11A0a3 Observe that initializer list for map and vector works without any error in main function. vector<int> v and map<char,int> m compiles without error. As per my understanding , these lines compiles because vector and map has compiler generated initializer_list constructor since C++11. Correct me if I am wrong. Now, go to constructor of class clsForVector. m_input = ls; compiles and works without error. where as m_input = ls; does not compile for constructor of class clsForMap. Why this behavior? Does this means C++11 has assignment operator overloaded for initializer list in case of vector and not for map... If not, what's the reason of compilation failure. If yes , why default assignment with initializer is not there for map?