CPSC170A
Fundamentals of Computer Science II

Lab 25

Maps

Map

Create a C++ class Map that maps ints to strings. The class should have the following functions:

// create an empty map
Map::Map()

// delete any dynamically allocated memory
Map::~Map()

// insert a key/value pair
// if the key is already in the map, update the key's value
void Map::insert(int key, std::string value)

// return a copy of the value associated with a key
// function should assert that key is in the map
std::string Map::at(int key) const

// print all of the key/value pairs of a map
std::ostream& operator<<(std::ostream& os, const Map& map)