Resize the hash table and rehash every element
Advice 1

for (int i = 0; i &lt; newSize; i++) {
    if (T[i] != empty) {


Did you intend to iterate only over size entries from T? If so, you need:

for (int i = 0; i &lt; size; i++) {
    if (T[i] != empty) {


Advice 2

T = newTable;
delete newTable;


You deallocate the actual new table array. Also, since you don't delete the table pointed to by T, you leak memory. I think your intention was to write:

delete[] T;
T = newTable;


Advice 3

T is not a good name for a hash table, since people can confuse it with a type parameter. Consider using something like storage_array, storage_table, table, or similar.