From 3d6f9ef89788dbb64c2a6b4becb84905667b1485 Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Wed, 11 Jun 2014 20:35:39 +0200 Subject: [PATCH] BitField: Add an explicit getter function for retrieving the BitField value. Sometimes (in particular when using non-typesafe functions) it can be convenient to have a getter method rather than performing a potentially lengthy explicit cast. --- Source/Core/Common/BitField.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Core/Common/BitField.h b/Source/Core/Common/BitField.h index 0dda177b59..8ec80de9c0 100644 --- a/Source/Core/Common/BitField.h +++ b/Source/Core/Common/BitField.h @@ -147,7 +147,7 @@ public: return *this; } - __forceinline operator T() const + __forceinline T Value() const { if (std::numeric_limits::is_signed) { @@ -160,6 +160,11 @@ public: } } + __forceinline operator T() const + { + return Value(); + } + private: // 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