i have an insert function:
template <typename T>
void insert(T item)
{
string T_id = typeid(T).name();
int compare;
if(T_id == "char *")
compare = stricmp(this.item, item);
else
compare = this.item < item;
// ... insert here
}
i'm trying to compare numbers,strings,classes but when T is <char*> i guess i have to use stricmp
instead of comparing with <,> when i compile this it's giving me an error at "compare = stricmp(this.item, item);"
if T is not <char*> how do i get around this or ignore stricmp when T is not char * ... hope this makes sense