std::ranges...it_view::end(3)
π 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)
- Returns an iterator representing the end of the view.
Equivalent to:
return /*outer_iterator*/</*simple_view*/<V>>{*this,
ranges::end(base_)};
- Returns an
outer_iteratoror astd::default_sentinelrepresenting 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 ofstd::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
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms