PDA

View Full Version : How value_type of map class is used?


yleemci
11-08-2009, 02:16 AM
I am not sure why value_type is needed for map object. operator [] can be used to populate a map.


map <int, int> mInt;

mInt.insert ( map <int, int> :: value_type ( 1, 10 ) );

mInt[ 1 ] = 10;;

Trinithis
11-08-2009, 06:58 AM
http://www.cppreference.com/wiki/stl/map/insert