aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/algorithm.h
diff options
context:
space:
mode:
authorrichard <richard@yandex-team.ru>2022-02-10 16:52:06 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:52:06 +0300
commit3d614c8de544db53c298060cd32d4119154be35a (patch)
tree42dba2ca5911fd8ba60884db03c5208e5cd5e794 /util/generic/algorithm.h
parentc51a16470c0065cef7d3f961d0cbe80cf5e6a0fd (diff)
downloadydb-3d614c8de544db53c298060cd32d4119154be35a.tar.gz
Restoring authorship annotation for <richard@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/generic/algorithm.h')
-rw-r--r--util/generic/algorithm.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/util/generic/algorithm.h b/util/generic/algorithm.h
index badfb88993..34b58dba1c 100644
--- a/util/generic/algorithm.h
+++ b/util/generic/algorithm.h
@@ -126,20 +126,20 @@ static inline auto Find(C&& c, const T& v) {
return std::find(begin(c), end(c), v);
}
-// FindPtr - return NULL if not found. Works for arrays, containers, iterators
-template <class I, class T>
-static inline auto FindPtr(I f, I l, const T& v) -> decltype(&*f) {
- I found = Find(f, l, v);
- return (found != l) ? &*found : nullptr;
-}
-
-template <class C, class T>
-static inline auto FindPtr(C&& c, const T& v) {
+// FindPtr - return NULL if not found. Works for arrays, containers, iterators
+template <class I, class T>
+static inline auto FindPtr(I f, I l, const T& v) -> decltype(&*f) {
+ I found = Find(f, l, v);
+ return (found != l) ? &*found : nullptr;
+}
+
+template <class C, class T>
+static inline auto FindPtr(C&& c, const T& v) {
using std::begin;
using std::end;
return FindPtr(begin(c), end(c), v);
-}
-
+}
+
template <class I, class P>
static inline I FindIf(I f, I l, P p) {
return std::find_if(f, l, p);