diff options
| author | 2018-09-05 02:24:44 +0200 | |
|---|---|---|
| committer | 2019-02-13 21:15:15 +0100 | |
| commit | efd83570bdb70597b3e06eeb3bced5486ac85eab (patch) | |
| tree | 8188354ba10169b4edabc20770b48de2069056a8 /src/common/bit_field.h | |
| parent | remove all occurance of specifying endianness inside BitField (diff) | |
| download | yuzu-efd83570bdb70597b3e06eeb3bced5486ac85eab.tar.gz yuzu-efd83570bdb70597b3e06eeb3bced5486ac85eab.tar.xz yuzu-efd83570bdb70597b3e06eeb3bced5486ac85eab.zip | |
Make bitfield assignment operator public
This change needs to be made to get the code compiling again. It was suggested after a conversation with Lioncash.
The conversation can be seen here: https://user-images.githubusercontent.com/20753089/45064197-b6107800-b0b2-11e8-9db8-f696299fb86a.PNG
Diffstat (limited to '')
| -rw-r--r-- | src/common/bit_field.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/common/bit_field.h b/src/common/bit_field.h index bd9e21e1e..639efe22d 100644 --- a/src/common/bit_field.h +++ b/src/common/bit_field.h | |||
| @@ -112,12 +112,6 @@ | |||
| 112 | template <std::size_t Position, std::size_t Bits, typename T, typename EndianTag = LETag> | 112 | template <std::size_t Position, std::size_t Bits, typename T, typename EndianTag = LETag> |
| 113 | struct BitField { | 113 | struct BitField { |
| 114 | private: | 114 | private: |
| 115 | // We hide the copy assigment operator here, because the default copy | ||
| 116 | // assignment would copy the full storage value, rather than just the bits | ||
| 117 | // relevant to this particular bit field. | ||
| 118 | // We don't delete it because we want BitField to be trivially copyable. | ||
| 119 | constexpr BitField& operator=(const BitField&) = default; | ||
| 120 | |||
| 121 | // UnderlyingType is T for non-enum types and the underlying type of T if | 115 | // UnderlyingType is T for non-enum types and the underlying type of T if |
| 122 | // T is an enumeration. Note that T is wrapped within an enable_if in the | 116 | // T is an enumeration. Note that T is wrapped within an enable_if in the |
| 123 | // former case to workaround compile errors which arise when using | 117 | // former case to workaround compile errors which arise when using |
| @@ -131,6 +125,8 @@ private: | |||
| 131 | using StorageTypeWithEndian = typename AddEndian<StorageType, EndianTag>::type; | 125 | using StorageTypeWithEndian = typename AddEndian<StorageType, EndianTag>::type; |
| 132 | 126 | ||
| 133 | public: | 127 | public: |
| 128 | BitField& operator=(const BitField&) = default; | ||
| 129 | |||
| 134 | /// Constants to allow limited introspection of fields if needed | 130 | /// Constants to allow limited introspection of fields if needed |
| 135 | static constexpr std::size_t position = Position; | 131 | static constexpr std::size_t position = Position; |
| 136 | static constexpr std::size_t bits = Bits; | 132 | static constexpr std::size_t bits = Bits; |