Skip to content

Commit

Permalink
Make constructors for BitMask constexpr. (#31343)
Browse files Browse the repository at this point in the history
BitFlags already has these constexpr, it seems we likely want
the same from bit masks.
  • Loading branch information
andy31415 authored and pull[bot] committed Jan 13, 2024
1 parent 7742714 commit 1057336
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib/support/BitMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ class BitMask : public BitFlags<FlagsEnum, StorageType>
public:
using IntegerType = typename BitFlags<FlagsEnum, StorageType>::IntegerType;

BitMask() : BitFlags<FlagsEnum, StorageType>() {}
BitMask(const BitFlags<FlagsEnum, StorageType> & other) : BitFlags<FlagsEnum, StorageType>(other) {}
BitMask(BitFlags<FlagsEnum, StorageType> && other) : BitFlags<FlagsEnum, StorageType>(std::move(other)) {}
constexpr BitMask() : BitFlags<FlagsEnum, StorageType>() {}
constexpr BitMask(const BitFlags<FlagsEnum, StorageType> & other) : BitFlags<FlagsEnum, StorageType>(other) {}
constexpr BitMask(BitFlags<FlagsEnum, StorageType> && other) : BitFlags<FlagsEnum, StorageType>(std::move(other)) {}
BitMask(const BitMask &) = default;

explicit BitMask(FlagsEnum value) : BitFlags<FlagsEnum, StorageType>(value) {}
explicit BitMask(IntegerType value) : BitFlags<FlagsEnum, StorageType>(value) {}

template <typename... Args>
BitMask(FlagsEnum flag, Args &&... args) : BitFlags<FlagsEnum, StorageType>(flag, std::forward<Args>(args)...)
constexpr BitMask(FlagsEnum flag, Args &&... args) : BitFlags<FlagsEnum, StorageType>(flag, std::forward<Args>(args)...)
{}

template <typename... Args>
BitMask(IntegerType value, Args &&... args) : BitFlags<FlagsEnum, StorageType>(value, std::forward<Args>(args)...)
constexpr BitMask(IntegerType value, Args &&... args) : BitFlags<FlagsEnum, StorageType>(value, std::forward<Args>(args)...)
{}

BitMask & operator=(const BitMask &) = default;
Expand Down

0 comments on commit 1057336

Please sign in to comment.