Template Function rsl::is_unique

Function Documentation

template<typename Collection>
auto rsl::is_unique(Collection collection)

Determine if all elements in a collection are unique. Example usage:

rsl::is_unique(std::vector{2,2}); // false
rsl::is_unique(std::vector{1,2,3}); // true

Because of how this function is implemented, the collection parameter is taken by value, creating a copy. The implication of this is that it will not work on collections of non-copy-able objects.