BitField: Add StartBit() and NumBits() accessors

This commit is contained in:
Stenzek 2017-06-27 18:14:04 +10:00
parent 3e508fc0a2
commit 416afa065c

View file

@ -141,6 +141,8 @@ public:
constexpr T Value() const { return Value(std::is_signed<T>()); } constexpr T Value() const { return Value(std::is_signed<T>()); }
constexpr operator T() const { return Value(); } constexpr operator T() const { return Value(); }
constexpr std::size_t StartBit() const { return position; }
constexpr std::size_t NumBits() const { return bits; }
private: private:
// StorageType is T for non-enum types and the underlying type of T if // StorageType is T for non-enum types and the underlying type of T if
// T is an enumeration. Note that T is wrapped within an enable_if in the // T is an enumeration. Note that T is wrapped within an enable_if in the