diff options
author | max42 <max42@yandex-team.ru> | 2022-02-10 16:47:51 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:51 +0300 |
commit | 9988f7c537b40605e1a0aaae2977d5f540425b83 (patch) | |
tree | a4f3497f66e2dcd82d0f7ae7573acd1320d1bc78 /util | |
parent | 0a579de32b745908473b2cea7c5cd5540bc801f0 (diff) | |
download | ydb-9988f7c537b40605e1a0aaae2977d5f540425b83.tar.gz |
Restoring authorship annotation for <max42@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util')
-rw-r--r-- | util/generic/size_literals.h | 32 | ||||
-rw-r--r-- | util/generic/size_literals_ut.cpp | 32 |
2 files changed, 32 insertions, 32 deletions
diff --git a/util/generic/size_literals.h b/util/generic/size_literals.h index 0b78b18687..142052d05c 100644 --- a/util/generic/size_literals.h +++ b/util/generic/size_literals.h @@ -22,14 +22,14 @@ constexpr ui64 operator"" _TB(unsigned long long value) noexcept { return value * 1024_GB; } -constexpr ui64 operator"" _PB(unsigned long long value) noexcept { - return value * 1024_TB; -} - -constexpr ui64 operator"" _EB(unsigned long long value) noexcept { - return value * 1024_PB; -} - +constexpr ui64 operator"" _PB(unsigned long long value) noexcept { + return value * 1024_TB; +} + +constexpr ui64 operator"" _EB(unsigned long long value) noexcept { + return value * 1024_PB; +} + // Signed literals namespace NPrivate { @@ -55,11 +55,11 @@ constexpr i64 operator"" _GBs(unsigned long long value) noexcept { constexpr i64 operator"" _TBs(unsigned long long value) noexcept { return ::NPrivate::SignedCast(value * 1024_GB); } - -constexpr i64 operator"" _PBs(unsigned long long value) noexcept { - return ::NPrivate::SignedCast(value * 1024_TB); -} - -constexpr i64 operator"" _EBs(unsigned long long value) noexcept { - return ::NPrivate::SignedCast(value * 1024_PB); -} + +constexpr i64 operator"" _PBs(unsigned long long value) noexcept { + return ::NPrivate::SignedCast(value * 1024_TB); +} + +constexpr i64 operator"" _EBs(unsigned long long value) noexcept { + return ::NPrivate::SignedCast(value * 1024_PB); +} diff --git a/util/generic/size_literals_ut.cpp b/util/generic/size_literals_ut.cpp index 410e22c39d..70b37ac23a 100644 --- a/util/generic/size_literals_ut.cpp +++ b/util/generic/size_literals_ut.cpp @@ -21,14 +21,14 @@ void CompileTestUnsigned() { static_assert(57_TB == 57_GB * 1024, "Wrong 57TB value"); static_assert(1023_TB == 1023_GB * 1024, "Wrong 1023TB value"); - static_assert(1_PB == 1_TB * 1024, "Wrong 1PB value"); - static_assert(9_PB == 9_TB * 1024, "Wrong 9PB value"); - static_assert(42_PB == 42_TB * 1024, "Wrong 42PB value"); - static_assert(1023_PB == 1023_TB * 1024, "Wrong 1023PB value"); - - static_assert(1_EB == 1_PB * 1024, "Wrong 1EB value"); - static_assert(9_EB == 9_PB * 1024, "Wrong 9EB value"); - + static_assert(1_PB == 1_TB * 1024, "Wrong 1PB value"); + static_assert(9_PB == 9_TB * 1024, "Wrong 9PB value"); + static_assert(42_PB == 42_TB * 1024, "Wrong 42PB value"); + static_assert(1023_PB == 1023_TB * 1024, "Wrong 1023PB value"); + + static_assert(1_EB == 1_PB * 1024, "Wrong 1EB value"); + static_assert(9_EB == 9_PB * 1024, "Wrong 9EB value"); + static_assert(9000000_TB == 9000000_GB * 1024, "Wrong 9000000TB value"); } @@ -53,14 +53,14 @@ void CompileTestSigned() { static_assert(57_TBs == 57_GBs * 1024, "Wrong 57TBs value"); static_assert(1023_TBs == 1023_GBs * 1024, "Wrong 1023TBs value"); - static_assert(1_PBs == 1_TBs * 1024, "Wrong 1PBs value"); - static_assert(9_PBs == 9_TBs * 1024, "Wrong 9PBs value"); - static_assert(42_PBs == 42_TBs * 1024, "Wrong 42PBs value"); - static_assert(1023_PBs == 1023_TBs * 1024, "Wrong 1023PBs value"); - - static_assert(1_EBs == 1_PBs * 1024, "Wrong 1EBs value"); - static_assert(7_EBs == 7_PBs * 1024, "Wrong 7EBs value"); - + static_assert(1_PBs == 1_TBs * 1024, "Wrong 1PBs value"); + static_assert(9_PBs == 9_TBs * 1024, "Wrong 9PBs value"); + static_assert(42_PBs == 42_TBs * 1024, "Wrong 42PBs value"); + static_assert(1023_PBs == 1023_TBs * 1024, "Wrong 1023PBs value"); + + static_assert(1_EBs == 1_PBs * 1024, "Wrong 1EBs value"); + static_assert(7_EBs == 7_PBs * 1024, "Wrong 7EBs value"); + static_assert(8388607_TBs == 8388607_GBs * 1024, "Wrong 8388607TBs value"); // 2**23 - 1 TB // Should cause compilation error if uncommented |