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

Function enum_reflected

include/magic_enum/magic_enum.hpp:1460–1470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1458// Returns true if the enum integer value is in the range of values that can be reflected.
1459template <typename E, detail::enum_subtype S = detail::subtype_v<E>>
1460[[nodiscard]] constexpr auto enum_reflected(underlying_type_t<E> value) noexcept -> detail::enable_if_t<E, bool> {
1461 using D = std::decay_t<E>;
1462
1463 if constexpr (detail::is_reflected_v<D, S>) {
1464 constexpr auto min = detail::reflected_min<E, S>();
1465 constexpr auto max = detail::reflected_max<E, S>();
1466 return value >= min && value <= max;
1467 } else {
1468 return false;
1469 }
1470}
1471
1472// Returns true if the enum value is in the range of values that can be reflected.
1473template <typename E, detail::enum_subtype S = detail::subtype_v<E>>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected