diff options
Diffstat (limited to 'src/common/bit_field.h')
| -rw-r--r-- | src/common/bit_field.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/common/bit_field.h b/src/common/bit_field.h index 21e07925d..7433c39ba 100644 --- a/src/common/bit_field.h +++ b/src/common/bit_field.h | |||
| @@ -111,12 +111,6 @@ | |||
| 111 | template <std::size_t Position, std::size_t Bits, typename T> | 111 | template <std::size_t Position, std::size_t Bits, typename T> |
| 112 | struct BitField { | 112 | struct BitField { |
| 113 | private: | 113 | private: |
| 114 | // We hide the copy assigment operator here, because the default copy | ||
| 115 | // assignment would copy the full storage value, rather than just the bits | ||
| 116 | // relevant to this particular bit field. | ||
| 117 | // We don't delete it because we want BitField to be trivially copyable. | ||
| 118 | constexpr BitField& operator=(const BitField&) = default; | ||
| 119 | |||
| 120 | // UnderlyingType is T for non-enum types and the underlying type of T if | 114 | // UnderlyingType is T for non-enum types and the underlying type of T if |
| 121 | // T is an enumeration. Note that T is wrapped within an enable_if in the | 115 | // T is an enumeration. Note that T is wrapped within an enable_if in the |
| 122 | // former case to workaround compile errors which arise when using | 116 | // former case to workaround compile errors which arise when using |
| @@ -163,9 +157,13 @@ public: | |||
| 163 | BitField(T val) = delete; | 157 | BitField(T val) = delete; |
| 164 | BitField& operator=(T val) = delete; | 158 | BitField& operator=(T val) = delete; |
| 165 | 159 | ||
| 166 | // Force default constructor to be created | 160 | constexpr BitField() noexcept = default; |
| 167 | // so that we can use this within unions | 161 | |
| 168 | constexpr BitField() = default; | 162 | constexpr BitField(const BitField&) noexcept = default; |
| 163 | constexpr BitField& operator=(const BitField&) noexcept = default; | ||
| 164 | |||
| 165 | constexpr BitField(BitField&&) noexcept = default; | ||
| 166 | constexpr BitField& operator=(BitField&&) noexcept = default; | ||
| 169 | 167 | ||
| 170 | constexpr FORCE_INLINE operator T() const { | 168 | constexpr FORCE_INLINE operator T() const { |
| 171 | return Value(); | 169 | return Value(); |