std::ranges...y_split_view(3)
π std::ranges...y_split_view(3) π
okay bestie, welcome to the std::ranges...y_split_view(3) page from the C++ Standard Libary (yes, that's literally how it's spelled up top, no cap π). this is all about std::ranges::lazy_split_view::lazy_split_view β the constructor, the icon, the moment. let's get into it β¨
πΈ NAME πΈ
std::ranges::lazy_split_view::lazy_split_view β literally the constructor for std::ranges::lazy_split_view. that's the whole name section, periodt π
β¨ Synopsis β¨
here's the exact synopsis, bestie β don't let the formatting jump-scare you, it's giving "copy-pasted from a PDF" energy but every token is sacred:
lazy_split_view()
requires std::default_initializable<V> &&
(1) (since C++20)
std::default_initializable<Pattern> = default;
constexpr explicit lazy_split_view( V base, Pattern pattern );
(2) (since C++20)
template< ranges::input_range R >
requires std::constructible_from<V, views::all_t<R>> &&
std::constructible_from<Pattern, ranges::single_view<
(3)
(since C++20)
ranges::range_value_t<R>>>
constexpr explicit lazy_split_view( R&& r,
ranges::range_value_t<R> e );
Constructs a lazy_split_view. so what do these three overloads actually do? buckle up:
- (1) (since C++20) β the default constructor. it value-initializes the underlying view and the delimiter. no args, just vibes β¨
- (2) (since C++20) β initializes the underlying view with
std::move(base)and the delimiter withstd::move(pattern). move semantics, we love to see it π - (3) (since C++20) β initializes the underlying view with
views::all(std::forward<R>(r))and the delimiter withranges::single_view{std::move(e)}. fancy forwarding, iconic π«Ά
π Parameters π
baseβ the underlying view (to be split). it's the main character being chopped up πpatternβ view to be used as the delimiter. the thing doing the chopping βοΈeβ element to be used as the delimiter. a single element doing the chopping, lowkey powerful π
π¦ Example π¦
This section is incomplete Reason: no example
literally that's it. not me showing up with no example π but the page says what it says.
π Defect reports π
The following behavior-changing defect reports were applied retroactively to previously published C++ standards. (yes, retroactively, the committee said "we fixed it after the fact, you're welcome" π)
- DR:
LWG 3714(P2711R1) - Applied to:
C++20 - Behavior as published: the multi-parameter constructor was not made explicit
- Correct behavior: explicit
π Category π
- Todo no example
shoutout to http://cppreference.com, version 2024.06.10, page std::ranges...y_split_view(3) β mwah π go construct something cute, bestie π§π
π¦ 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