386 constexpr Mask_t maskA(Mask_t::fromValues, 0b011
'011'011, 0b001
'001'001);
387 constexpr Mask_t maskB(Mask_t::fromValues, 0b000
'111'111, 0b000
'000'111);
388 constexpr Mask_t::Bits_t bitsB (0b000
'000'111);
393 constexpr Mask_t maskMAB(Mask_t::fromValues, 0b011
'111'111, 0b001
'000'111);
394 static_assert(Mask_t::mergeIntoMask(maskA, maskB) == maskMAB,
395 "mergeIntoMask(Mask_t, Mask_t) failure");
397 (maskA + maskB == maskMAB,
"maskA + maskB failure");
399 constexpr Mask_t maskMBA(Mask_t::fromValues, 0b011
'111'111, 0b001
'001'101);
400 static_assert(Mask_t::mergeIntoMask(maskB, maskA) == maskMBA,
401 "mergeIntoMask(Mask_t, Mask_t) failure");
403 (maskB + maskA == maskMBA,
"maskB + maskA failure");
408 constexpr Mask_t maskMAbB(Mask_t::fromValues, 0b011
'011'111, 0b001
'001'111);
409 static_assert(Mask_t::mergeIntoMask(maskA, bitsB) == maskMAbB,
410 "mergeIntoMask(Mask_t, Bits_t) failure");
412 (maskA + bitsB == maskMAbB,
"maskA + bitsB failure");
414 constexpr Mask_t maskMbBA(Mask_t::fromValues, 0b011
'011'111, 0b001
'001'101);
415 static_assert(bitsB + maskA == maskMbBA,
"bitsB + maskA failure");
420 constexpr Mask_t maskCAB(Mask_t::fromValues, 0b011
'111'111, 0b001
'001'111);
421 static_assert(Mask_t::combineWithMask(maskA, maskB) == maskCAB,
422 "combineWithMask(Mask_t, Mask_t) failure");
424 ((maskA | maskB) == maskCAB,
"maskA | maskB failure");
426 constexpr Mask_t maskCBA(Mask_t::fromValues, 0b011
'111'111, 0b001
'001'111);
427 static_assert(Mask_t::combineWithMask(maskB, maskA) == maskCBA,
428 "combineWithMask(Mask_t, Mask_t) failure");
430 ((maskB | maskA) == maskCBA,
"maskB | maskA failure");
435 constexpr Mask_t maskCAbB(Mask_t::fromValues, 0b011
'011'111, 0b001
'001'111);
436 static_assert(Mask_t::combineWithMask(maskA, bitsB) == maskCAbB,
437 "combineWithMask(Mask_t, Bits_t) failure");
439 ((maskA | bitsB) == maskCAbB,
"maskA | bitsB failure");
441 constexpr Mask_t maskCbBA(Mask_t::fromValues, 0b011
'011'111, 0b001
'001'111);
443 ((bitsB | maskA) == maskCbBA,
"bitsB | maskA failure");
448 constexpr Mask_t maskIAB(Mask_t::fromValues, 0b011
'111'111, 0b001
'000'101);
449 static_assert(Mask_t::intersectWithMask(maskA, maskB) == maskIAB,
450 "intersectWithMask(Mask_t, Mask_t) failure");
451 static_assert((maskA & maskB) == maskIAB,
"maskA & maskB failure");
453 constexpr Mask_t maskIBA(Mask_t::fromValues, 0b011
'111'111, 0b001
'000'101);
454 static_assert(Mask_t::intersectWithMask(maskB, maskA) == maskIBA,
455 "intersectWithMask(Mask_t, Mask_t) failure");
456 static_assert((maskB & maskA) == maskIBA,
"maskB & maskA failure");
461 constexpr Mask_t maskIAbB(Mask_t::fromValues, 0b011
'011'111, 0b001
'001'101);
462 static_assert(Mask_t::intersectWithMask(maskA, bitsB) == maskIAbB,
463 "intersectWithMask(Mask_t, Bits_t) failure");
465 ((maskA & bitsB) == maskIAbB,
"maskA & bitsB failure");
467 constexpr Mask_t maskIbBA(Mask_t::fromValues, 0b011
'011'111, 0b001
'001'101);
468 static_assert((bitsB & maskA) == maskIbBA,
"bitsB & maskA failure");
473 constexpr Mask_t maskUAB(Mask_t::fromValues, 0b011
'111'111, 0b001
'001'000);
474 static_assert(Mask_t::unsetMask(maskA, maskB) == maskUAB,
475 "unsetMask(Mask_t, Mask_t) failure");
476 static_assert((maskA - maskB) == maskUAB,
"maskA - maskB failure");
478 constexpr Mask_t maskUBA(Mask_t::fromValues, 0b011
'111'111, 0b000
'000'110);
479 static_assert(Mask_t::unsetMask(maskB, maskA) == maskUBA,
480 "unsetMask(Mask_t, Mask_t) failure");
481 static_assert((maskB - maskA) == maskUBA,
"maskB - maskA failure");
486 constexpr Mask_t maskUAbB(Mask_t::fromValues, 0b011
'011'111, 0b001
'001'000);
487 static_assert(Mask_t::unsetMask(maskA, bitsB) == maskUAbB,
488 "unsetMask(Mask_t, Bits_t) failure");
489 static_assert((maskA - bitsB) == maskUAbB,
"maskA - bitsB failure");
491 constexpr Mask_t maskUbBA(Mask_t::fromValues, 0b011
'011'111, 0b000
'000'110);
492 static_assert((bitsB - maskA) == maskUbBA,
"bitsB - maskA failure");
497 constexpr Mask_t maskNA(Mask_t::fromValues, 0b011
'011'011, 0b010
'010'010);
499 (Mask_t::negateMask(maskA) == maskNA,
"negateMask(Mask_t) failure");
500 static_assert(~maskA == maskNA,
"~mask failure");
505 constexpr Mask_t maskNbB(Mask_t::fromValues, 0b000
'000'111, 0b000
'000'000);
507 (Mask_t::negateMask(bitsB) == maskNbB,
"negateMask(Bits_t) failure");
513 constexpr Mask_t maskbB(Mask_t::fromValues, 0b000
'000'111, 0b000
'000'111);
514 static_assert(+maskA == maskA,
"+mask failure");
515 static_assert(+bitsB == maskbB,
"+bits failure");
520 static_assert(maskA + (-bitsB) == maskA - bitsB,
"-bits failure");
A class containing a set of flags.