I'm trying to run through a std::list to print some elements see if they hace been correctly inserted in my Hash Table but I just can't understand why the following declaration is wrong (Compiler keeps on telling me my iterator is not defined or asks me for a semicolon right before its name declaration) PLEASE HELP!
Code:
/**
*
*
*
*
**/
template <class T> class hash{
public:
hash(int n){
this->numEntradas = n;
this->table = new vector<list<T> >();
this->table->resize(numEntradas);
}
~hash(){
delete this->table;
this->table = 0;
this->numEntradas = 0;
}
T* search(const T& item){
}
void insert(const T& item){
int indice = hashFunction(item);
this->table->at(indice).push_front(item);
}
int hashFunction(const T& key){
return (key % numEntradas);
}
void printHashTable(){
for(int i = 0; i < numEntradas; ++i){
list<T> * buffer = this->table[i];
list<T>::iterator posicion = buffer->begin();
}
}