Sfoglia il codice sorgente

bit_field: Convert ToBool() into explicit operator bool

Gets rid of a TODO that is long overdue.
Lioncash 8 anni fa
parent
commit
36090521ce
1 ha cambiato i file con 1 aggiunte e 2 eliminazioni
  1. 1 2
      src/common/bit_field.h

+ 1 - 2
src/common/bit_field.h

@@ -178,8 +178,7 @@ public:
         return ExtractValue(storage);
         return ExtractValue(storage);
     }
     }
 
 
-    // TODO: we may want to change this to explicit operator bool() if it's bug-free in VS2015
-    constexpr FORCE_INLINE bool ToBool() const {
+    constexpr explicit operator bool() const {
         return Value() != 0;
         return Value() != 0;
     }
     }