/* Lecture Code 8.2
 *
 * The boost::assign library, which makes it easier to
 * initialize containers with known contents.
 */

#include <iostream>
#include <string>
#include <algorithm>
#include <iterator>
#include <vector>
#include <map>
#include <boost/assign.hpp>
using namespace std;
using namespace boost::assign;

int main() {
	/* Create a vector containing several prime numbers using the
	 * boost::assign library.
	 */
	vector<int> primes;
	primes += 2, 3, 5, 7, 11, 13, 17;

	/* Create a map translating various slang expressions using
	 * the boost::assign library.
	 */
	map<string, string> lexicon;
	insert(lexicon)
			("Yo sup?", "Hello!  How are you?")
			("Coolio!", "Interesting!")
			("Rockin'!", "That is exciting!");

	/* Print the primes. */
	copy(primes.begin(), primes.end(), ostream_iterator<int>(cout, "\n"));

	/* Print the pairs. */
	for (map<string, string>::iterator itr = lexicon.begin(); itr != lexicon.end(); ++itr)
		cout << itr->first << ": " << itr->second << endl;
	return 0;
}