aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/threading/skip_list/compare.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/threading/skip_list/compare.h
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
downloadydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/threading/skip_list/compare.h')
-rw-r--r--library/cpp/threading/skip_list/compare.h114
1 files changed, 57 insertions, 57 deletions
diff --git a/library/cpp/threading/skip_list/compare.h b/library/cpp/threading/skip_list/compare.h
index 336582a1b8..ac98b3e1ce 100644
--- a/library/cpp/threading/skip_list/compare.h
+++ b/library/cpp/threading/skip_list/compare.h
@@ -4,74 +4,74 @@
#include <util/str_stl.h>
namespace NThreading {
- namespace NImpl {
- Y_HAS_MEMBER(compare);
- Y_HAS_MEMBER(Compare);
+ namespace NImpl {
+ Y_HAS_MEMBER(compare);
+ Y_HAS_MEMBER(Compare);
template <typename T>
- inline int CompareImpl(const T& l, const T& r) {
- if (l < r) {
- return -1;
- } else if (r < l) {
- return +1;
- } else {
- return 0;
- }
+ inline int CompareImpl(const T& l, const T& r) {
+ if (l < r) {
+ return -1;
+ } else if (r < l) {
+ return +1;
+ } else {
+ return 0;
+ }
}
- template <bool val>
- struct TSmallCompareSelector {
- template <typename T>
- static inline int Compare(const T& l, const T& r) {
- return CompareImpl(l, r);
- }
- };
+ template <bool val>
+ struct TSmallCompareSelector {
+ template <typename T>
+ static inline int Compare(const T& l, const T& r) {
+ return CompareImpl(l, r);
+ }
+ };
- template <>
- struct TSmallCompareSelector<true> {
- template <typename T>
- static inline int Compare(const T& l, const T& r) {
- return l.compare(r);
- }
- };
+ template <>
+ struct TSmallCompareSelector<true> {
+ template <typename T>
+ static inline int Compare(const T& l, const T& r) {
+ return l.compare(r);
+ }
+ };
- template <bool val>
- struct TBigCompareSelector {
- template <typename T>
- static inline int Compare(const T& l, const T& r) {
+ template <bool val>
+ struct TBigCompareSelector {
+ template <typename T>
+ static inline int Compare(const T& l, const T& r) {
return TSmallCompareSelector<THascompare<T>::value>::Compare(l, r);
- }
- };
-
- template <>
- struct TBigCompareSelector<true> {
- template <typename T>
- static inline int Compare(const T& l, const T& r) {
- return l.Compare(r);
- }
- };
-
+ }
+ };
+
+ template <>
+ struct TBigCompareSelector<true> {
+ template <typename T>
+ static inline int Compare(const T& l, const T& r) {
+ return l.Compare(r);
+ }
+ };
+
template <typename T>
struct TCompareSelector: public TBigCompareSelector<THasCompare<T>::value> {
- };
- }
+ };
+ }
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // Generic compare function
- ////////////////////////////////////////////////////////////////////////////////
- // Generic compare function
-
template <typename T>
- inline int Compare(const T& l, const T& r) {
- return NImpl::TCompareSelector<T>::Compare(l, r);
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- // Generic compare functor
-
- template <typename T>
- struct TCompare {
- inline int operator()(const T& l, const T& r) const {
- return Compare(l, r);
- }
+ inline int Compare(const T& l, const T& r) {
+ return NImpl::TCompareSelector<T>::Compare(l, r);
+ }
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // Generic compare functor
+
+ template <typename T>
+ struct TCompare {
+ inline int operator()(const T& l, const T& r) const {
+ return Compare(l, r);
+ }
};
}