From 1057336892f5f8fa46a958a1daa0a80d05034daa Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 10 Jan 2024 13:00:09 -0500 Subject: [PATCH] Make constructors for `BitMask` constexpr. (#31343) BitFlags already has these constexpr, it seems we likely want the same from bit masks. --- src/lib/support/BitMask.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/support/BitMask.h b/src/lib/support/BitMask.h index d614e681f4e945..e2a656db6ca3bf 100644 --- a/src/lib/support/BitMask.h +++ b/src/lib/support/BitMask.h @@ -33,20 +33,20 @@ class BitMask : public BitFlags public: using IntegerType = typename BitFlags::IntegerType; - BitMask() : BitFlags() {} - BitMask(const BitFlags & other) : BitFlags(other) {} - BitMask(BitFlags && other) : BitFlags(std::move(other)) {} + constexpr BitMask() : BitFlags() {} + constexpr BitMask(const BitFlags & other) : BitFlags(other) {} + constexpr BitMask(BitFlags && other) : BitFlags(std::move(other)) {} BitMask(const BitMask &) = default; explicit BitMask(FlagsEnum value) : BitFlags(value) {} explicit BitMask(IntegerType value) : BitFlags(value) {} template - BitMask(FlagsEnum flag, Args &&... args) : BitFlags(flag, std::forward(args)...) + constexpr BitMask(FlagsEnum flag, Args &&... args) : BitFlags(flag, std::forward(args)...) {} template - BitMask(IntegerType value, Args &&... args) : BitFlags(value, std::forward(args)...) + constexpr BitMask(IntegerType value, Args &&... args) : BitFlags(value, std::forward(args)...) {} BitMask & operator=(const BitMask &) = default;