Is there anyway to specialize a template like this, making the specialization apply only if T has a member function `hash`? (Note this is only an example of what I am trying to do. I know that it would make more sense for each class that has a `hash` function to check it on its own in the `operator==` member function, but I just want to know if this kind of thing is possible.)

```
template <class T>
bool equals(const T &x, const T &y)
{
    return x == y;
}

template <class T> // somehow check if T has a member function 'hash'
bool equals<T>(const T &x, const T &y)
{
    return x.hash() == y.hash() && x == y;
}

```

I would prefer a pre-C++11 solution if possible.