I am trying to write a templated function named unique()
that detects if a std::vector
only has unique elements, using only the <vector>
, <set>
and <iostream>
headers.
template <typename T>
bool unique(const std::vector<T>& container){}
How can I manage to do this?