diff options
author | Neil <nyamatongwe@gmail.com> | 2021-05-28 09:29:15 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-05-28 09:29:15 +1000 |
commit | dc2e91331dab55730cbd29d4d64a37adc26ed2a6 (patch) | |
tree | f227285651267985458d13f73e5b08d4b8f8d8f8 | |
parent | 731550032428395d08ff082dc7bb4d2015d20c47 (diff) | |
download | scintilla-mirror-dc2e91331dab55730cbd29d4d64a37adc26ed2a6.tar.gz |
Fix FlagSet to return true if any flags set.
-rw-r--r-- | include/ScintillaTypes.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/ScintillaTypes.h b/include/ScintillaTypes.h index 6b5714b69..5b9b8023f 100644 --- a/include/ScintillaTypes.h +++ b/include/ScintillaTypes.h @@ -775,10 +775,10 @@ constexpr KeyMod operator&(KeyMod a, KeyMod b) noexcept { return static_cast<KeyMod>(static_cast<int>(a) & static_cast<int>(b)); } -// Test if an enum class value has the bit flag(s) of test set. +// Test if an enum class value has some bit flag(s) of test set. template <typename T> constexpr bool FlagSet(T value, T test) { - return (static_cast<int>(value) & static_cast<int>(test)) == static_cast<int>(test); + return (static_cast<int>(value) & static_cast<int>(test)) != 0; } } |