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

Function enum_contains

include/magic_enum/magic_enum.hpp:1426–1431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1424// Returns true if enum contains value with such value.
1425template <typename E, detail::enum_subtype S = detail::subtype_v<E>>
1426[[nodiscard]] constexpr auto enum_contains(E value) noexcept -> detail::enable_if_t<E, bool> {
1427 using D = std::decay_t<E>;
1428 using U = underlying_type_t<D>;
1429
1430 return static_cast<bool>(enum_cast<D, S>(static_cast<U>(value)));
1431}
1432
1433// Returns true if enum contains value with such value.
1434template <detail::enum_subtype S, typename E>

Callers 4

test_flags.cppFile · 0.85
test.cppFile · 0.85
test_nonascii.cppFile · 0.85
getFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected