summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-06-20 22:49:05 +0200
committerBardur Arantsson <bardur@scientician.net>2016-06-20 22:49:05 +0200
commitdb149f696b2c063df0e5b5bdd66dc0931760b3ec (patch)
tree6a4c5779756033f3c84b4198a72f89e80c8a59ec /src
parent0cb03efd7c438ee8fc5d9444e0c8e60a8eeb7f16 (diff)
Add negation operator to flag_set<>
Diffstat (limited to 'src')
-rw-r--r--src/flag_set.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/flag_set.hpp b/src/flag_set.hpp
index cbc4e7aa..2e5d46ea 100644
--- a/src/flag_set.hpp
+++ b/src/flag_set.hpp
@@ -119,6 +119,16 @@ public:
return f;
}
+ constexpr flag_set operator ~ () const
+ {
+ flag_set f;
+ for (std::size_t i = 0; i < tiers; i++)
+ {
+ f.m_data[i] = ~m_data[i];
+ }
+ return f;
+ }
+
};
// Implementation details, because preprocessor.