tag/Mask: add static_assert on the size of the mask

This commit is contained in:
Max Kellermann 2023-10-08 09:58:41 +02:00
parent 49130c2018
commit f3c37e484e
1 changed files with 5 additions and 0 deletions

View File

@ -26,6 +26,11 @@
class TagMask {
typedef uint_least32_t mask_t;
/* the mask must have enough bits to represent all tags
supported by MPD */
static_assert(TAG_NUM_OF_ITEM_TYPES <= sizeof(mask_t) * 8);
mask_t value;
explicit constexpr TagMask(uint_least32_t _value) noexcept