STL之hashtable

template<class Value>
struct __hashtable_node
{
      __hashtable_node *next;
      Value val; 
};

template<class Value, class Key>
struct __hashtable_iterator
{
typedef __hashtable_node<Value> node;
typedef hashtable<Value, Key> hashtable;

node *cur;
hashtable *ht;

__hashtable_iterator(node *n, hashtable *tab): cur(n), ht(tab){}
__hashtable_iterator(){}

reference operator*() const{ return cur->val;}
};

template<class Value, class Key>
class hashtable
{
private:
vector<node*> buckets;
size_type num_elements;
};

 

posted @ 2015-03-17 18:46  啊哈灵机一动  阅读(231)  评论(0)    收藏  举报