.. _sized_sentinel_for: ************************ meta::sized_sentinel_for ************************ Defined in header ````. .. code-block:: cpp template concept sized_sentinel_for = meta::sentinel_for && requires(I const& i, S const& s) { { s - i } -> meta::same_as>; { i - s } -> meta::same_as>; } }; Pre-C++20 implementation of the :iterconcept:`sized_sentinel_for` concept. ---- Differences with the C++20 version ================================== * There is no ``disable_sized_sentinel`` customization point. Concept emulation ================= .. code-block:: cpp namespace mgs { namespace meta { template struct is_sized_sentinel { /* ... */ }; template constexpr auto is_sized_sentinel_v = is_sized_sentinel::value; template >> using sized_sentinel_for = S; } // namespace meta } // namespace mgs Example ======= .. code-block:: cpp #include using namespace mgs::meta; static_assert(is_sized_sentinel_for_v, ""); static_assert(is_sized_sentinel_for_v::iterator, std::vector::iterator>, ""); static_assert(!is_sized_sentinel_for_v::iterator, std::list::iterator>, ""); See also ======== * :ref:`sentinel_for` * :ref:`iter_difference_t`