/*
** SellaNMS
** $Id: hashmap.cxx,v 2.4 2005/03/31 18:57:11 sella Exp $
** Copyright (c) 2001-2005 Digital Genesis Software, LLC. All Rights Reserved.
** Released under the GPL Version 2 License.
** http://www.digitalgenesis.com
*/

/* Notes:

This is an erample of hash_map doing a deep copy.

*/

#include <stdio.h>
#include <stdlib.h>
#include <str>
#include <vector>
#include <hash_map>

int main() {
	hash_map<int, vector<str> > h;
	vector<str> v;
	str r = "GOOD";
	v.insert(v.end(), r);

	/* Add vector<str> with 'GOOD' stored within. */
	h[0] = v;

	/* Now replace contents of our vector. */
	r = "BAD";
	v.pop_back();
	v.insert(v.end(), r);

	/* Print out what is stored within our hash_map. */
	printf("Should be 'GOOD' in hash_map: %s\n", h[0].back().c_str());

	return 0;
}
