I am learning stl features for the first time , so this code is from dietel and i wanted to implement in dev-c++ orwell 5.4 , but the code doesn't run , what is the problem . Are stl libraries not included in dev-cpp ?
And it is showing error - map doesnot name a type ?
#include <iostream>
#include <map>
typedef map< int , double , less< int > > Mid ;
using namespace std ;
int main()
{
Mid pairs ;
pairs.insert( Mid::value_type( 15 , 2.7 ) ) ;
pairs.insert( Mid::value_type( 30 , 111.11 ) ) ;
pairs.insert( Mid::value_type( 5 , 1010.1 ) ) ;
pairs.insert( Mid::value_type( 10 , 22.22 ) ) ;
pairs.insert( Mid::value_type( 25 , 33.333 ) ) ;
pairs.insert( Mid::value_type( 5 , 77.54 ) ) ;
pairs.insert( Mid::value_type( 20 , 9.345 ) ) ;
pairs.insert( Mid::value_type( 15 , 99.3 ) ) ;
cout << "pairs contains:\nKey\tValue\n" ;
for( Mid::const_iterator iter = pairs.begin() ;
iter != pairs.end() ; ++iter )
cout << iter->first << '\t' << iter->second << '\n' ;
pairs[ 25 ] = 9999.99 ;
pairs[ 40 ] = 8765.43 ;
cout << endl ;
cout << "After subscript operations: " ;
cout << endl ;
for( Mid::const_iterator iter = pairs.begin() ;
iter != pairs.end() ; ++iter )
cout << iter->first << '\t' << iter->second << '\n' ;
cout << endl ;
return 0 ;
}