std::ranges...le_view::end(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’… std::ranges...le_view::end(3) β€” C++ Standard Libary πŸ’…

okay bestie, this is the end() page for take_while_view, and no cap it’s shorter than it looks β€” but every little constraint matters, so here we go 🫢


🌸 NAME 🌸

std::ranges::take_while_view::end β€” std::ranges::take_while_view::end


✨ Synopsis ✨

here’s the exact synopsis vibe, both overloads since C++20:

          constexpr auto end() requires (!__SimpleView<V>);
       (1) (since C++20)
          constexpr auto end() const requires

              ranges::range<const V> &&
       (2) (since C++20)

              std::indirect_unary_predicate<const Pred,
          ranges::iterator_t<const V>>;

it returns a sentinel representing the end of the view πŸ’–

let base_ denote the underlying view. so like:

  1. overload (1) effectively returns /*sentinel*/<false>(ranges::end(base_), std::addressof(pred())).
  2. overload (2) effectively returns /*sentinel*/<true>(ranges::end(base_), std::addressof(pred())).
⚠️ and listen: overload (1) does not participate in overload resolution if V is a simple view β€” that is, if V and const V are views with the same iterator and sentinel types. that constraint is iconic, don’t ignore it πŸ’…

πŸŽ€ Parameters πŸŽ€

none. zero. zilch. 🫢


πŸ’– Return value πŸ’–

a sentinel representing the end of the view. periodt. ✨


πŸ¦‹ Example πŸ¦‹

This section is incomplete.

Reason: no example.

so yeah, no example here β€” the source literally says that πŸ™ˆ


🌈 Defect reports 🌈

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

  • DR: LWG 3450
  • Applied to: C++20
  • Behavior as published: the const overload might return a sentinel constrained non-comparable to the iterator
  • Correct behavior: (none shown separately in the source text)

πŸ‘‘ See also πŸ‘‘

  • begin β€” returns an iterator to the beginning (C++20) (public member function)
  • operator== β€” compares a sentinel with an iterator returned from take_while_view::begin (C++20) (function)

πŸ“ Category πŸ“

  • Todo no example

made with πŸ’– from http://cppreference.com, dated 2024.06.10, for std::ranges...le_view::end(3) β€” bye bestie, go read the constraints again πŸ‘‹βœ¨

πŸ“¦ where this page comes from