diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2023-01-25 12:15:43 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-25 12:15:43 +0100 |
| commit | 70b2a6736b6b12836adc142b85f0b0d333dd112a (patch) | |
| tree | 938db5944dbbac053ca271dd63ba6159ebaaf4b5 /Source/Core | |
| parent | 6db2171fd0365d40e7ee86f2a46faa053f0553db (diff) | |
| parent | 0d93a31a3838226b4d14085f3512f2c39d4b1c6b (diff) | |
Merge pull request #11491 from lioncash/set
Common/BitSet: Mark initializer_list constructor as constexpr
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Common/BitSet.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/Core/Common/BitSet.h b/Source/Core/Common/BitSet.h index ad7df6afcd..5d2c88294d 100644 --- a/Source/Core/Common/BitSet.h +++ b/Source/Core/Common/BitSet.h @@ -93,11 +93,10 @@ public: int m_bit; }; - constexpr BitSet() : m_val(0) {} + constexpr BitSet() = default; constexpr explicit BitSet(IntTy val) : m_val(val) {} - BitSet(std::initializer_list<int> init) + constexpr BitSet(std::initializer_list<int> init) { - m_val = 0; for (int bit : init) m_val |= (IntTy)1 << bit; } @@ -132,7 +131,7 @@ public: constexpr unsigned int Count() const { return std::popcount(m_val); } constexpr Iterator begin() const { return ++Iterator(m_val, 0); } constexpr Iterator end() const { return Iterator(m_val, -1); } - IntTy m_val; + IntTy m_val{}; }; } // namespace Common |
