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 /library/cpp/enumbitset/enumbitset.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 'library/cpp/enumbitset/enumbitset.h')
-rw-r--r-- | library/cpp/enumbitset/enumbitset.h | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/library/cpp/enumbitset/enumbitset.h b/library/cpp/enumbitset/enumbitset.h index 41864c3a04..82cb4d34c7 100644 --- a/library/cpp/enumbitset/enumbitset.h +++ b/library/cpp/enumbitset/enumbitset.h @@ -22,20 +22,20 @@ public: typedef TEnumBitSet<TEnum, mbegin, mend> TThis; TEnumBitSet() - : TParent(0) - { - } + : TParent(0) + { + } - explicit TEnumBitSet(const TParent& p) - : TParent(p) - { - } + explicit TEnumBitSet(const TParent& p) + : TParent(p) + { + } void Init(TEnum c) { Set(c); } - template <class... R> + template <class... R> void Init(TEnum c1, TEnum c2, R... r) { Set(c1); Init(c2, r...); @@ -45,7 +45,7 @@ public: Init(c); } - template <class... R> + template <class... R> TEnumBitSet(TEnum c1, TEnum c2, R... r) { Init(c1, c2, r...); } @@ -133,7 +133,7 @@ public: return ret; } - bool operator<(const TThis& right) const { + bool operator<(const TThis& right) const { Y_ASSERT(this->GetChunkCount() == right.GetChunkCount()); for (size_t i = 0; i < this->GetChunkCount(); ++i) { if (this->GetChunks()[i] < right.GetChunks()[i]) @@ -144,48 +144,48 @@ public: return false; } - bool operator!=(const TThis& right) const { - return !(TParent::operator==(right)); + bool operator!=(const TThis& right) const { + return !(TParent::operator==(right)); } - bool operator==(const TThis& right) const { - return TParent::operator==(right); + bool operator==(const TThis& right) const { + return TParent::operator==(right); } - TThis& operator&=(const TThis& right) { - TParent::operator&=(right); + TThis& operator&=(const TThis& right) { + TParent::operator&=(right); return *this; } - TThis& operator|=(const TThis& right) { - TParent::operator|=(right); + TThis& operator|=(const TThis& right) { + TParent::operator|=(right); return *this; } - TThis& operator^=(const TThis& right) { - TParent::operator^=(right); + TThis& operator^=(const TThis& right) { + TParent::operator^=(right); return *this; } - TThis operator~() const { + TThis operator~() const { TThis r = *this; r.Flip(); return r; } - TThis operator|(const TThis& right) const { + TThis operator|(const TThis& right) const { TThis ret = *this; ret |= right; return ret; } - TThis operator&(const TThis& right) const { + TThis operator&(const TThis& right) const { TThis ret = *this; ret &= right; return ret; } - TThis operator^(const TThis& right) const { + TThis operator^(const TThis& right) const { TThis ret = *this; ret ^= right; return ret; @@ -224,7 +224,7 @@ public: return TParent::operator[](this->Pos(e)); } - using TParent::Count; + using TParent::Count; using TParent::Empty; explicit operator bool() const { @@ -243,7 +243,7 @@ public: return TParent::HasAny(mask); } - template <class... R> + template <class... R> bool HasAny(TEnum c1, R... r) const { return Test(c1) || HasAny(r...); } @@ -252,7 +252,7 @@ public: return TParent::HasAll(mask); } - template <class... R> + template <class... R> bool HasAll(TEnum c1, R... r) const { return Test(c1) && HasAll(r...); } @@ -265,7 +265,7 @@ public: } } - void Load(IInputStream* buffer) { + void Load(IInputStream* buffer) { Reset(); ui32 sz = 0; @@ -336,15 +336,15 @@ public: return true; } - bool any() const { // obsolete + bool any() const { // obsolete return !Empty(); } - bool none() const { // obsolete + bool none() const { // obsolete return Empty(); } - size_t count() const { // obsolete + size_t count() const { // obsolete return Count(); } @@ -362,12 +362,12 @@ public: { } - TEnum operator*() const noexcept { + TEnum operator*() const noexcept { Y_ASSERT(Value < EndIndex); return static_cast<TEnum>(Value); } - bool operator!=(const TIterator& other) const noexcept { + bool operator!=(const TIterator& other) const noexcept { return Value != other.Value; } @@ -400,7 +400,7 @@ public: private: static size_t Pos(TEnum c) { Y_ASSERT(IsValid(c)); - return static_cast<size_t>(int(c) - BeginIndex); + return static_cast<size_t>(int(c) - BeginIndex); } bool HasAny(TEnum c) const { @@ -433,19 +433,19 @@ private: }; template <typename TEnum, TEnum mbegin, int mend> -class TSfEnumBitSet: public TEnumBitSet<TEnum, mbegin, mend> { +class TSfEnumBitSet: public TEnumBitSet<TEnum, mbegin, mend> { public: typedef TEnumBitSet<TEnum, mbegin, mend> TParent; TSfEnumBitSet() - : TParent() - { - } + : TParent() + { + } - TSfEnumBitSet(const TParent& p) - : TParent(p) - { - } + TSfEnumBitSet(const TParent& p) + : TParent(p) + { + } //! unsafe initialization from ui64, value must be shifted according to TParent::Begin explicit TSfEnumBitSet(ui64 val) @@ -458,7 +458,7 @@ public: this->SafeSet(c); } - template <class... R> + template <class... R> void Init(TEnum c1, TEnum c2, R... r) { this->SafeSet(c1); Init(c2, r...); @@ -468,7 +468,7 @@ public: Init(c); } - template <class... R> + template <class... R> TSfEnumBitSet(TEnum c1, TEnum c2, R... r) { Init(c1, c2, r...); } |