mrdocs::sentinel_traits<T>

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>;

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.

Return the floating‐point NaN sentinel.

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.

Return the enum sentinel value.

Static Member Functions

Name

Description

is_sentinel

Return true if the value equals the sentinel.

sentinel

Return the sentinel value (~0u).

Created with MrDocs