OK, arrays are indexed by int (or unsigned int), but in the constuctor you're trying to index it by type T, which may not be an int.
Also, you can't initialise like that - you'll have to move the assignment to the body of the constructor. Also, I suspect you want to use the hash_fn to get the index, for example:
Yeah exactly, I am right now doing what you mentioned above(and my above code is just for finding bugs with the int)...... and I am using the hash_fn too..... I was just wondering why two ints cant copy construct
array[data] = data;
constructor() : array[data](data) { }
if you see both array[data] and data are ints or i.e T is int......
Please change the code
int array[MAX_HASH_SIZE];
to
T array[MAX_HASH_SIZE];
(I was in the mode of debugging and not meant to confuse you, sorry)
Now both the array and data are of type T(int)...... it still shows the same error.... any idea????