Overloading function in a template class

Hi,

I want to do a specialisation for int and float but i don't know is not ok.

template<typename K, typename V>
class H_Table {

private :
A_List<K,V> tab[SIZE_TABLEAU];

public:

static int hashage(K clef);
};

in .tpp

// Spécialisation pour les int
template<typename K, typename V>
int H_Table<K,V>::hashage(K clef)
{return -1;}

// Spécialisation pour les floats
template<typename V>
int H_Table<int,V>::hashage(int clef)
{return clef;}

What is the problem ?
When I write int H_Table<int,int>::hashage(int clef)it's ok, but V must be template V..

Thank you for your help.
Last edited on
Topic archived. No new replies allowed.