Ver Fonte

BitField: Add an explicit evaluation method.

Sometimes it can be beneficial to use this in places where an explicit cast needs to happen otherwise. By using the evaluation method, it's not necessary anymore to explicitly write the underlying type in this case.
Tony Wasserka há 12 anos atrás
pai
commit
47a001722d
1 ficheiros alterados com 5 adições e 0 exclusões
  1. 5 0
      src/common/bit_field.h

+ 5 - 0
src/common/bit_field.h

@@ -131,6 +131,11 @@ public:
     }
     }
 
 
     __forceinline operator T() const
     __forceinline operator T() const
+    {
+        return Value();
+    }
+
+    __forceinline T Value() const
     {
     {
         if (std::numeric_limits<T>::is_signed)
         if (std::numeric_limits<T>::is_signed)
         {
         {