From 36090521ce34303fc2c5d73b9da46748f6630ed8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 21 Aug 2018 06:39:42 -0400 Subject: bit_field: Convert ToBool() into explicit operator bool Gets rid of a TODO that is long overdue. --- src/common/bit_field.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/common/bit_field.h b/src/common/bit_field.h index 65e357dec..732201de7 100644 --- a/src/common/bit_field.h +++ b/src/common/bit_field.h @@ -178,8 +178,7 @@ public: 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; } -- cgit v1.2.3