diff options
author | Bardur Arantsson <bardur@scientician.net> | 2016-06-20 22:49:05 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2016-06-20 22:49:05 +0200 |
commit | 145ea9e004c6014c790abb8d7b81f7f1547af3b9 (patch) | |
tree | f11869d7682a9e97a335b2baeba7458db6ff4473 /src/flag_set.hpp | |
parent | ca3fab4c43e155494e7eddfede551f3ced7ddad0 (diff) |
Change flag_set bool conversion to 'explicit'
Diffstat (limited to 'src/flag_set.hpp')
-rw-r--r-- | src/flag_set.hpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/flag_set.hpp b/src/flag_set.hpp index aa90a217..490f0daf 100644 --- a/src/flag_set.hpp +++ b/src/flag_set.hpp @@ -92,11 +92,21 @@ public: return m_data[i]; } - constexpr operator bool() const + explicit constexpr operator bool() const { return !empty(); } + constexpr bool operator == (flag_set const &other) const + { + return m_data == other.m_data; + } + + constexpr bool operator != (flag_set const &other) const + { + return !(*this == other); + } + constexpr bool bit(std::size_t i) const { assert(i < nbits); |