c++ - In STL maps, is it better to use map::insert than []? - Stack Overflow
One note is that you can also use Boost.Assign:
using namespace std; using namespace boost::assign; // bring 'map_list_of()' into scope void something() { map<int,int> my_map = map_list_of(1,2)(2,3)(3,4)(4,5)(5,6); }