bit_field: Make all methods constexpr.
This commit is contained in:
parent
5f80075c31
commit
e24c7a474c
|
@ -125,7 +125,7 @@ private:
|
||||||
using StorageTypeWithEndian = typename AddEndian<StorageType, EndianTag>::type;
|
using StorageTypeWithEndian = typename AddEndian<StorageType, EndianTag>::type;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BitField& operator=(const BitField&) = default;
|
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;
|
||||||
|
@ -166,15 +166,15 @@ public:
|
||||||
// so that we can use this within unions
|
// so that we can use this within unions
|
||||||
constexpr BitField() = default;
|
constexpr BitField() = default;
|
||||||
|
|
||||||
FORCE_INLINE operator T() const {
|
constexpr FORCE_INLINE operator T() const {
|
||||||
return Value();
|
return Value();
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCE_INLINE void Assign(const T& value) {
|
constexpr FORCE_INLINE void Assign(const T& value) {
|
||||||
storage = (static_cast<StorageType>(storage) & ~mask) | FormatValue(value);
|
storage = (static_cast<StorageType>(storage) & ~mask) | FormatValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCE_INLINE T Value() const {
|
constexpr T Value() const {
|
||||||
return ExtractValue(storage);
|
return ExtractValue(storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue