diff options
author | mowgli <[email protected]> | 2022-02-10 16:49:25 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:25 +0300 |
commit | 56c39b3cf908e7202b1f7551a1653681e8015607 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/enumbitset | |
parent | 89afbbe4ca0e02e386dd4df08f7945f190dc1b84 (diff) |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/enumbitset')
-rw-r--r-- | library/cpp/enumbitset/enumbitset.h | 14 | ||||
-rw-r--r-- | library/cpp/enumbitset/enumbitset_ut.cpp | 20 |
2 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/enumbitset/enumbitset.h b/library/cpp/enumbitset/enumbitset.h index 9e1ae2d9385..41864c3a04f 100644 --- a/library/cpp/enumbitset/enumbitset.h +++ b/library/cpp/enumbitset/enumbitset.h @@ -8,9 +8,9 @@ #include <util/string/printf.h> #include <util/system/yassert.h> -// Stack memory bitmask for TEnum values [begin, end). -// @end value is not included in the mask and is not necessarily defined as enum value. -// For example: enum EType { A, B, C } ==> TEnumBitSet<EType, A, C + 1> +// Stack memory bitmask for TEnum values [begin, end). +// @end value is not included in the mask and is not necessarily defined as enum value. +// For example: enum EType { A, B, C } ==> TEnumBitSet<EType, A, C + 1> template <typename TEnum, int mbegin, int mend> class TEnumBitSet: private TBitMap<mend - mbegin> { public: @@ -227,10 +227,10 @@ public: using TParent::Count; using TParent::Empty; - explicit operator bool() const { - return !Empty(); - } - + explicit operator bool() const { + return !Empty(); + } + void Swap(TThis& bitmap) { TParent::Swap(bitmap); } diff --git a/library/cpp/enumbitset/enumbitset_ut.cpp b/library/cpp/enumbitset/enumbitset_ut.cpp index d80d50b5d8a..e55b3251c34 100644 --- a/library/cpp/enumbitset/enumbitset_ut.cpp +++ b/library/cpp/enumbitset/enumbitset_ut.cpp @@ -34,18 +34,18 @@ Y_UNIT_TEST_SUITE(TEnumBitSetTest) { ebs.SafeSet(TE_OVERFLOW); UNIT_ASSERT(!ebs.SafeTest(TE_OVERFLOW)); - } + } Y_UNIT_TEST(TestEmpty) { - TTestBitSet mask; - UNIT_ASSERT(mask.Empty()); - if (mask) - UNIT_ASSERT(false && "should be empty"); - - mask.Set(TE_FIRST); - UNIT_ASSERT(!mask.Empty()); - UNIT_ASSERT(mask.Count() == 1); - if (!mask) + TTestBitSet mask; + UNIT_ASSERT(mask.Empty()); + if (mask) + UNIT_ASSERT(false && "should be empty"); + + mask.Set(TE_FIRST); + UNIT_ASSERT(!mask.Empty()); + UNIT_ASSERT(mask.Count() == 1); + if (!mask) UNIT_ASSERT(false && "should not be empty"); } |