summaryrefslogtreecommitdiff
path: root/src/common/bit_field.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-04-14 20:40:39 -0400
committerGitHub <noreply@github.com>2018-04-14 20:40:39 -0400
commitfdca7b5f7a4ca626c15e70ae6f684e88686277f5 (patch)
tree57b8c1f1952c53d54a0c14b00543dd21302d661b /src/common/bit_field.h
parentc6ab2c94d9fd7e82d780e0598bfe8c982661d1aa (diff)
parent1b41b875dcd24c662b947731f48f4d1c7131fa0b (diff)
Merge pull request #329 from bunnei/shader-gen-part-1
OpenGL shader generation part 1
Diffstat (limited to 'src/common/bit_field.h')
-rw-r--r--src/common/bit_field.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/bit_field.h b/src/common/bit_field.h
index 0cc0a1be0..5638bdbba 100644
--- a/src/common/bit_field.h
+++ b/src/common/bit_field.h
@@ -115,7 +115,7 @@ private:
// assignment would copy the full storage value, rather than just the bits
// relevant to this particular bit field.
// We don't delete it because we want BitField to be trivially copyable.
- BitField& operator=(const BitField&) = default;
+ constexpr BitField& operator=(const BitField&) = default;
// 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
@@ -166,20 +166,20 @@ public:
// so that we can use this within unions
constexpr BitField() = default;
- FORCE_INLINE operator T() const {
+ constexpr FORCE_INLINE operator T() const {
return Value();
}
- FORCE_INLINE void Assign(const T& value) {
+ constexpr FORCE_INLINE void Assign(const T& value) {
storage = (storage & ~mask) | FormatValue(value);
}
- FORCE_INLINE T Value() const {
+ constexpr T Value() const {
return ExtractValue(storage);
}
// TODO: we may want to change this to explicit operator bool() if it's bug-free in VS2015
- FORCE_INLINE bool ToBool() const {
+ constexpr FORCE_INLINE bool ToBool() const {
return Value() != 0;
}