// © Copyright 1997. Joseph Bergin. All rights reserved.#ifndef MAP_HASH_H#define MAP_HASH_H#include "hashtable.h"template <class KEY, class DATA, class HASHER, class EQUAL>class map_hash{public:	typedef pair<const KEY, DATA> value_type;	typedef KEY key_type;	typedef hash_table<value_type, HASHER, EQUAL>::iterator iterator;	// bidirectional iterator	typedef KEY key_type;	typedef DATA& reference;	typedef HASHER hash_type;	typedef EQUAL equal_type;		map_hash(): rep(){}		iterator insert (KEY t, DATA v)	{	value_type p(t,v);		pair<rep_type::iterator, bool> where = rep.find(p);		if(!where.second)			return rep.insert(p);		return where.first;	}		hash_type hash_function(){return rep.hash_function();}	equal_type comparer(){return rep.comparer();}	int erase(KEY t)	{	value_type p(t,DATA());		return rep.erase(p);	}		iterator find(const key_type& k)	{	pair<iterator, bool> where = rep.find(value_type(k,DATA()));		if(where.second) return where.first;		return end();	}		iterator begin(){ return rep.begin();}	iterator end(){return rep.end();}    bool empty() const { return rep.empty();}    int size()const{return rep.size();}	reference operator[](const key_type& k)	{	return (*(insert(k, DATA()))).second;	}	// NOTE that this inserts the DATA default value into the map 		// for your key if the key is not originally present.  	protected:	typedef hash_table<value_type, HASHER, EQUAL> rep_type;	rep_type rep;};#endif