I wrote the following function for the purpose of reusability:

```
template<typename T>
bool contains(vector<T> v, T x)
{
      if (v.empty())
           return false;
      if (find(v.begin(), v.end(), x) != v.end())
           return true;
      else
           return false;
}

```

Is this the correct way to do, oor is there any better (or more efficient) way?