From 70ac638d935eaac120edb8135eeea03a7243dd09 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 15 Oct 2023 11:03:30 +0200 Subject: [PATCH] tag/Mask: make everything `constexpr` --- src/tag/Mask.hxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tag/Mask.hxx b/src/tag/Mask.hxx index 0caf66ad5..f7a69f046 100644 --- a/src/tag/Mask.hxx +++ b/src/tag/Mask.hxx @@ -20,7 +20,7 @@ class TagMask { :value(_value) {} public: - TagMask() = default; + constexpr TagMask() noexcept = default; constexpr TagMask(TagType tag) noexcept :value(mask_t(1) << mask_t(tag)) {} @@ -49,17 +49,17 @@ public: return TagMask(value ^ other.value); } - TagMask &operator&=(TagMask other) noexcept { + constexpr TagMask &operator&=(TagMask other) noexcept { value &= other.value; return *this; } - TagMask &operator|=(TagMask other) noexcept { + constexpr TagMask &operator|=(TagMask other) noexcept { value |= other.value; return *this; } - TagMask &operator^=(TagMask other) noexcept { + constexpr TagMask &operator^=(TagMask other) noexcept { value ^= other.value; return *this; } @@ -72,11 +72,11 @@ public: return (*this & tag).TestAny(); } - void Set(TagType tag) noexcept { + constexpr void Set(TagType tag) noexcept { *this |= tag; } - void Unset(TagType tag) noexcept { + constexpr void Unset(TagType tag) noexcept { *this &= ~TagMask(tag); } };