I want to implement is_pointer. I want something like this:
template
bool is_pointer( T t )
{
// implementation
} // return true or fa
template
bool is_pointer(T const &t) // edited: was "T t"; see the comments
{
return false;
}
template
bool is_pointer(T *t)
{
return true;
}
You might not believe it, but it works. The reason is that the most specific template implementation will be chosen, which is the one which takes the pointer type.