/* Lecture Code 5.1
 *
 * Basic STL map usage.
 */
#include <iostream>
#include <map>
#include <string>
using namespace std;

int main()
{
	map<string, int> myMap;

	myMap.insert(make_pair("STL", 137));
	myMap.insert(make_pair("IS", 42));
	myMap.insert(make_pair("AWESOME", 2718));
	
	myMap["AWESOME"] = 271828;
	
	myMap.erase("IS");

	if(myMap.find("STL") != myMap.end())
		cout << "The STL exists." << endl;

	for(map<string, int>::iterator itr = myMap.begin(); itr != myMap.end(); ++itr)
		cout << "Key: " << itr->first << ", Value: " << itr->second << endl;

	return 0;
}