[base] Updated IsSortedAndUnique function.

Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
Viktor Govako
2025-07-03 20:01:54 -03:00
committed by Konstantin Pastbin
parent b7b87f5530
commit 7b4862b442
7 changed files with 12 additions and 12 deletions

View File

@@ -304,6 +304,12 @@ bool IsSortedAndUnique(Iter beg, Iter end, Compare comp)
return true;
}
template <typename ContT>
bool IsSortedAndUnique(ContT const & cont)
{
return IsSortedAndUnique(cont.begin(), cont.end(), std::less<>());
}
template <typename Iter, typename Compare>
Iter RemoveIfKeepValid(Iter beg, Iter end, Compare comp)
{
@@ -328,12 +334,6 @@ Iter RemoveIfKeepValid(Iter beg, Iter end, Compare comp)
return end;
}
template <typename Iter>
bool IsSortedAndUnique(Iter beg, Iter end)
{
return IsSortedAndUnique(beg, end, std::less<typename std::iterator_traits<Iter>::value_type>());
}
struct DeleteFunctor
{
template <typename T>