1
0
Fork 0

Merge pull request #4694 from FearlessTobi/port-2210

Port commit from yuzu-emu/yuzu#2210: "common/bit_field: Make BitField trivially copyable"
This commit is contained in:
Weiyi Wang 2019-03-22 11:22:53 -04:00 committed by GitHub
commit 17c0e903db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -125,8 +125,6 @@ private:
using StorageTypeWithEndian = typename AddEndian<StorageType, EndianTag>::type; using StorageTypeWithEndian = typename AddEndian<StorageType, EndianTag>::type;
public: public:
constexpr BitField& operator=(const BitField&) = default;
/// Constants to allow limited introspection of fields if needed /// Constants to allow limited introspection of fields if needed
static constexpr std::size_t position = Position; static constexpr std::size_t position = Position;
static constexpr std::size_t bits = Bits; static constexpr std::size_t bits = Bits;
@ -162,9 +160,13 @@ public:
BitField(T val) = delete; BitField(T val) = delete;
BitField& operator=(T val) = delete; BitField& operator=(T val) = delete;
// Force default constructor to be created constexpr BitField() noexcept = default;
// so that we can use this within unions
constexpr BitField() = default; constexpr BitField(const BitField&) noexcept = default;
constexpr BitField& operator=(const BitField&) noexcept = default;
constexpr BitField(BitField&&) noexcept = default;
constexpr BitField& operator=(BitField&&) noexcept = default;
constexpr operator T() const { constexpr operator T() const {
return Value(); return Value();