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.
This commit is contained in:
Tony Wasserka 2014-06-11 20:35:39 +02:00
parent 78fbf2ecaa
commit 3d6f9ef897

View File

@ -147,7 +147,7 @@ public:
return *this; return *this;
} }
__forceinline operator T() const __forceinline T Value() const
{ {
if (std::numeric_limits<T>::is_signed) if (std::numeric_limits<T>::is_signed)
{ {
@ -160,6 +160,11 @@ public:
} }
} }
__forceinline operator T() const
{
return Value();
}
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