Browse Source
Merge pull request #1139 from lioncash/bitfield
bit_field: Convert ToBool() into explicit operator bool
pull/15/merge
bunnei
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
2 deletions
-
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; |
|
|
|
} |
|
|
|
|
|
|
|
|