diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /util/generic/size_literals.h | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 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 0b78b18687..52c16b2711 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); } |