diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /util/generic/size_literals.h | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/size_literals.h')
-rw-r--r-- | util/generic/size_literals.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/util/generic/size_literals.h b/util/generic/size_literals.h index 52c16b2711..0b78b18687 100644 --- a/util/generic/size_literals.h +++ b/util/generic/size_literals.h @@ -6,19 +6,19 @@ // Unsigned literals -constexpr ui64 operator"" _KB(unsigned long long value) noexcept { +constexpr ui64 operator"" _KB(unsigned long long value) noexcept { return value * 1024; } -constexpr ui64 operator"" _MB(unsigned long long value) noexcept { +constexpr ui64 operator"" _MB(unsigned long long value) noexcept { return value * 1024_KB; } -constexpr ui64 operator"" _GB(unsigned long long value) noexcept { +constexpr ui64 operator"" _GB(unsigned long long value) noexcept { return value * 1024_MB; } -constexpr ui64 operator"" _TB(unsigned long long value) noexcept { +constexpr ui64 operator"" _TB(unsigned long long value) noexcept { return value * 1024_GB; } @@ -35,24 +35,24 @@ constexpr ui64 operator"" _EB(unsigned long long value) noexcept { namespace NPrivate { constexpr i64 SignedCast(ui64 value) { return value <= static_cast<ui64>(std::numeric_limits<i64>::max()) - ? static_cast<i64>(value) - : ythrow yexception() << "The resulting value " << value << " does not fit into the i64 type"; + ? static_cast<i64>(value) + : ythrow yexception() << "The resulting value " << value << " does not fit into the i64 type"; }; } -constexpr i64 operator"" _KBs(const unsigned long long value) noexcept { +constexpr i64 operator"" _KBs(const unsigned long long value) noexcept { return ::NPrivate::SignedCast(value * 1024); } -constexpr i64 operator"" _MBs(unsigned long long value) noexcept { +constexpr i64 operator"" _MBs(unsigned long long value) noexcept { return ::NPrivate::SignedCast(value * 1024_KB); } -constexpr i64 operator"" _GBs(unsigned long long value) noexcept { +constexpr i64 operator"" _GBs(unsigned long long value) noexcept { return ::NPrivate::SignedCast(value * 1024_MB); } -constexpr i64 operator"" _TBs(unsigned long long value) noexcept { +constexpr i64 operator"" _TBs(unsigned long long value) noexcept { return ::NPrivate::SignedCast(value * 1024_GB); } |