diff options
author | pavelgur <pavelgur@yandex-team.ru> | 2022-02-10 16:50:19 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:19 +0300 |
commit | db222959b3748242024c781f563f31a342492476 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/generic/utility.h | |
parent | 173c6a0fa7f439b2c207c2f258e52ccb4ac181cf (diff) | |
download | ydb-db222959b3748242024c781f563f31a342492476.tar.gz |
Restoring authorship annotation for <pavelgur@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/utility.h')
-rw-r--r-- | util/generic/utility.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/util/generic/utility.h b/util/generic/utility.h index 36501499b7..43b98eeafc 100644 --- a/util/generic/utility.h +++ b/util/generic/utility.h @@ -30,18 +30,18 @@ constexpr const T& ClampVal(const T& val, const T& min, const T& max) { return val < min ? min : (max < val ? max : val); } -template <typename T = double, typename... Args> -static T Mean(const Args&... other) noexcept { - const auto numArgs = sizeof...(other); - - auto sum = T(); - for (const auto& v : {other...}) { - sum += v; - } - - return sum / numArgs; -} - +template <typename T = double, typename... Args> +static T Mean(const Args&... other) noexcept { + const auto numArgs = sizeof...(other); + + auto sum = T(); + for (const auto& v : {other...}) { + sum += v; + } + + return sum / numArgs; +} + template <class T> static inline void Zero(T& t) noexcept { memset((void*)&t, 0, sizeof(t)); |