c++ - In STL maps, is it better to use map::insert than []? - Stack Overflow

c++ - In STL maps, is it better to use map::insert than []? - Stack Overflow


1
down vote

 

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); } 

你可能感兴趣的:(overflow)