So, that means that I have to use this... THING... to store all the info for the hash table...
- Code: Select all
vector<list<pair<Key, Val> > > hashTable;
The hash table will be a custom template class where Key is to be defined as a string and Val is to be defined as a floating-point number
That's right, a string and float being held by a Pair being held by lists being held by vectors... Sue me if I'm just confused about something here, but it seems to be the most bogus overcomplicated thing ever.
Anyhow, I guess I can put up with it, but somewhere along the line I need to do something like this in order to traverse the hashTable...
- Code: Select all
for (vector<list<pair<Key, Val> > >::iterator Ite = hashTable.begin(); Ite != hashTable.end(); Ite++)
Which by all means LOOKS correct, but... No, it doesn't work, never compiles. I get the standard "expected `;' before 'Ite' " compiler message, which naturally Google can't help me with because every n00b to C++ has posted that on a million message boards before wondering why "int a (endline)" wouldn't compile.
Does anyone know how I can propperly declare this iterator?