diff options
author | Mikhail Borisov <borisov.mikhail@gmail.com> | 2022-02-10 16:45:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:39 +0300 |
commit | a6a92afe03e02795227d2641b49819b687f088f8 (patch) | |
tree | f6984a1d27d5a7ec88a6fdd6e20cd5b7693b6ece /util/generic/algorithm.h | |
parent | c6dc8b8bd530985bc4cce0137e9a5de32f1087cb (diff) | |
download | ydb-a6a92afe03e02795227d2641b49819b687f088f8.tar.gz |
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'util/generic/algorithm.h')
-rw-r--r-- | util/generic/algorithm.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/util/generic/algorithm.h b/util/generic/algorithm.h index badfb88993..821ba709d0 100644 --- a/util/generic/algorithm.h +++ b/util/generic/algorithm.h @@ -73,16 +73,16 @@ static inline void StableSort(T f, T l, C c) { std::stable_sort(f, l, c); } -template <class TContainer> -static inline void StableSort(TContainer& container) { - StableSort(container.begin(), container.end()); -} - -template <class TContainer, typename TCompare> -static inline void StableSort(TContainer& container, TCompare compare) { - StableSort(container.begin(), container.end(), compare); -} - +template <class TContainer> +static inline void StableSort(TContainer& container) { + StableSort(container.begin(), container.end()); +} + +template <class TContainer, typename TCompare> +static inline void StableSort(TContainer& container, TCompare compare) { + StableSort(container.begin(), container.end(), compare); +} + template <class TIterator, typename TGetKey> static inline void StableSortBy(TIterator begin, TIterator end, const TGetKey& getKey) { StableSort(begin, end, [&](auto&& left, auto&& right) { return getKey(left) < getKey(right); }); @@ -278,11 +278,11 @@ static inline I LowerBound(I f, I l, const T& v, C c) { return std::lower_bound(f, l, v, c); } -template <class I, class T, class TGetKey> -static inline I LowerBoundBy(I f, I l, const T& v, const TGetKey& getKey) { - return std::lower_bound(f, l, v, [&](auto&& left, auto&& right) { return getKey(left) < right; }); -} - +template <class I, class T, class TGetKey> +static inline I LowerBoundBy(I f, I l, const T& v, const TGetKey& getKey) { + return std::lower_bound(f, l, v, [&](auto&& left, auto&& right) { return getKey(left) < right; }); +} + template <class I, class T> static inline I UpperBound(I f, I l, const T& v) { return std::upper_bound(f, l, v); @@ -293,11 +293,11 @@ static inline I UpperBound(I f, I l, const T& v, C c) { return std::upper_bound(f, l, v, c); } -template <class I, class T, class TGetKey> -static inline I UpperBoundBy(I f, I l, const T& v, const TGetKey& getKey) { - return std::upper_bound(f, l, v, [&](auto&& left, auto&& right) { return left < getKey(right); }); -} - +template <class I, class T, class TGetKey> +static inline I UpperBoundBy(I f, I l, const T& v, const TGetKey& getKey) { + return std::upper_bound(f, l, v, [&](auto&& left, auto&& right) { return left < getKey(right); }); +} + template <class T> static inline T Unique(T f, T l) { return std::unique(f, l); |