.. _sentinel_for: ****************** meta::sentinel_for ****************** Defined in header ````. .. code-block:: cpp template concept sentinel_for = meta::semiregular && meta::input_or_output_iterator && meta::weakly_equality_comparable_with Pre-C++20 implementation of the :iterconcept:`sentinel_for` concept. ---- Concept emulation ================= .. code-block:: cpp namespace mgs { namespace meta { template struct is_sentinel_for { /* ... */ }; template constexpr auto is_sentinel_for_v = is_sentinel_for::value; template >> using sentinel_for = S; } // namespace meta } // namespace mgs Example ======= .. code-block:: cpp #include using namespace mgs::meta; struct pointer_sentinel {}; bool operator==(char*, pointer_sentinel); bool operator!=(char*, pointer_sentinel); bool operator==(pointer_sentinel, char*); bool operator!=(pointer_sentinel, char*); static_assert(is_sentinel_for_v, ""); static_assert(is_sentinel_for_v, ""); static_assert(!is_sentinel_for_v::iterator>, ""); See also ======== * :ref:`semiregular` * :ref:`input_or_output_iterator` * :ref:`weakly_equality_comparable_with`