sentinel_traits specialization for unsigned integral types.

Synopsis

Declared in <mrdocs/ADT/Nullable.hpp>

template<std::floating_point T>
requires std::is_enum_v<T> &&
         (requires { T::unknown; } ||
          requires { T::Unknown; } ||
          requires { T::UNKNOWN; } ||
          requires { T::none; } ||
          requires { T::None; } ||
          requires { T::NONE; })
struct sentinel_traits<T>;

Static Member Functions

Description

Uses the maximum representable value (~0u) as the sentinel, which corresponds to ‐1 when converted.

sentinel_traits specialization for floating‐point types.

Uses a quiet NaN as the sentinel value. This assumes that T supports NaN and that it is distinguishable from all ordinary values.

sentinel_traits specialization for enums with a well‐known "null" enumerator.

If the enum defines Unknown, UNKNOWN, None, or NONE, this trait uses that enumerator as the sentinel. This requires that such an enumerator exists and is accessible from the scope of T.

Created with MrDocs