bool is_present(std::string value) const // Why to you pass the type std::string? I would expect the type T
{
bool is_ok = false;
for(ListCell *cur = head; cur; cur = cur->next)
{
if(value == cur->val)
{
is_ok = true;
break;
}
}
return is_ok;
}
You "get an error". Psychic are we? If yes, then you are too. Here: "an answer". You are welcome.
It would be common courtesy for you to show the error message.
Sure, we can compile your code and get some error message, but we might use different compiler. You should first learn to read the messages that your compiler writes. We cannot help in that, for we can't see what your system says.
For this time:
You have a function: bool List<Cat>::is_present( Cat ) const;
You call it with "Felix"
What is the effective type of constant string literal? Is it constchar*?