You have to resize the vector HashTable::table before you use it, or supply a size to its constructor. I'm not sure what vector::reserve does but my guess is it allocates memory but doesn't actually resize. If you're not going to be resizing the vector more than once you don't need to bother with reserve, just change it to resize.
|