MCPcopy Create free account
hub / github.com/Neargye/magic_enum / enum_flags_test

Function enum_flags_test

include/magic_enum/magic_enum_flags.hpp:197–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195// Note: If `flag` equals 0, it returns false, as 0 is not a flag.
196template <typename E>
197constexpr auto enum_flags_test(E flags, E flag) noexcept -> detail::enable_if_t<E, bool> {
198 using U = underlying_type_t<E>;
199
200 return static_cast<U>(flag) && ((static_cast<U>(flags) & static_cast<U>(flag)) == static_cast<U>(flag));
201}
202
203// Returns true if `lhs flags set` and `rhs flags set` have common flags.
204// Note: If `lhs flags set` or `rhs flags set` equals 0, it returns false, as 0 is not a flag, and therfore cannot have any matching flag.

Callers 1

test_flags.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected