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

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

πŸ’… std::ranges::lazy_split_view::end πŸ’…

okay bestie, this page comes from the C++ Standard Libary, manual section 3 β€” yes, that's the exact spelling on the page, we're not fixing it πŸ˜­πŸ’– It's the end member of std::ranges::lazy_split_view, and we're about to get you fully caught up ✨


🌸 NAME 🌸

std::ranges::lazy_split_view::end β€” std::ranges::lazy_split_view::end (it's giving "same name on both sides" and honestly? iconic 😌)

✨ Synopsis ✨

Here's the signature situation, no cap:

constexpr auto end() requires ranges::forward_range<V> &&
  ranges::common_range<V>;

(1) (since C++20)

constexpr auto end() const;

(2) (since C++20)

  1. Returns an iterator representing the end of the view.

Equivalent to:

return /*outer_iterator*/</*simple_view*/<V>>{*this,
ranges::end(base_)};
  1. Returns an outer_iterator or a std::default_sentinel representing the end of the view.

Equivalent to:

if constexpr (ranges::forward_range<V> && ranges::forward_range<const
V> &&
              ranges::common_range<const V>)
    return /*outer_iterator*/<true>{*this, ranges::end(base_)};
else
    return std::default_sentinel;

πŸŽ€ Parameters πŸŽ€

(none) β€” literally zero parameters, bestie 🫢

πŸ’– Return value πŸ’–

An outer_iterator or a std::default_sentinel representing the end of the view.

πŸ¦‹ Example πŸ¦‹

#include <iostream>
#include <ranges>
#include <string_view>

int main()
{
    constexpr std::string_view keywords{ "false float for friend" };
    std::ranges::lazy_split_view kw{ keywords, ' ' };
    const auto count = std::ranges::distance(kw.begin(), kw.end());
    std::cout << "Words count: " << count << '\n';
}

🌈 Output 🌈

Words count: 4

πŸ‘‘ See also πŸ‘‘

  • begin β€” returns an iterator to the beginning; (C++20) (public member function)
  • end β€” returns an iterator or a sentinel to the end; (C++20) (public member function of std::ranges::split_view<V,Pattern>)
  • ranges::begin β€” returns an iterator to the beginning of a range; (C++20) (customization point object)
  • ranges::end β€” returns a sentinel indicating the end of a range; (C++20) (customization point object)

okay that's the whole page, bestie πŸ’œ source/version: http://cppreference.com, date 2024.06.10, page std::ranges...it_view::end(3) β€” slay ✨

πŸ“¦ where this page comes from