Namespaces
Variants

std::ranges::lazy_split_view<V,Pattern>::begin

From cppreference.com
 
 
Ranges library
Range adaptors
 
 
constexpr auto begin();
(1) (since C++20)
constexpr auto begin() const
    requires ranges::forward_range<V> &&
             ranges::forward_range<const V> &&
             ranges::forward_range<const Pattern>;
(2) (since C++20)

Returns an outer_iterator to the first element of the lazy_split_view.

Let base_ be the underlying view and current_ be the underlying caching object (present only if ranges::forward_range<V> is false).

1) Equivalent to
constexpr auto begin()
{
    if constexpr (ranges::forward_range<V>)
    {
        constexpr bool simple = /*simple_view*/<V> && /*simple_view*/<Pattern>;
        return /*outer_iterator*/<simple>{*this, ranges::begin(base_)};
    }
    else
    {
        current_ = ranges::begin(base_);
        return /*outer_iterator*/<false>{*this};
    }
}
2) Equivalent to return /*outer_iterator*/<true>{*this, ranges::begin(base_)};.

Return value

outer_iterator to the first element.

Example

Defect reports

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

DR Applied to Behavior as published Correct behavior
LWG 3592 C++20 lazy_split_view does not check if Pattern is a simple view /*simple_view*/<Pattern> is examined
LWG 3599 C++20 the const overload (2) is not constrained by
ranges::forward_range<const Pattern>
constrained

See also

returns an iterator or a sentinel to the end
(public member function) [edit]
returns an iterator to the beginning of a range
(customization point object)[edit]