Skip to content

Commit b64e714

Browse files
committed
flags: Implemented a variant of the includes check that sees if a suite of flags are not set
1 parent 36507ba commit b64e714

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

substrate/flags

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ namespace substrate
6161
return (value & bits) == bits;
6262
}
6363

64+
template<typename... values_t, typename = std::enable_if_t<(std::is_same_v<values_t, enum_t> && ...)>>
65+
[[nodiscard]] constexpr bool excludes(const values_t ...flags) const noexcept
66+
{
67+
const storage_t bits{storage_t((flagAsBit(flags) | ...))};
68+
return (value & bits) == 0U;
69+
}
70+
6471
template<typename... values_t, typename = std::enable_if_t<(std::is_same_v<values_t, enum_t> && ...)>>
6572
[[nodiscard]] constexpr bitFlags_t without(const values_t ...flags) const noexcept
6673
{

0 commit comments

Comments
 (0)