Link error for user defined class type template parameter
- by isurulucky
Hi,
I implemented a Simple STL map in C++. Factored out the comparison as a type as I was instructed to, then implemented the comparison as shown below:
template <typename T> int KeyCompare<T>::operator () (T tKey1, T tKey2)
{
if(tKey1 < tKey2)
return -1;
else if(tKey1 > tKey2)
return 1;
else
…