Spec-Zone.ru › C++

std::ranges::drop_while_view<V,Pred>::end

constexpr auto end();
(since C++20)

Returns a sentinel or an iterator representing the end of the drop_while_view.

Effectively returns ranges::end(base_), where base_ is the underlying view.

Parameters

(none)

Return value

A sentinel or an iterator representing the end of the view.

Example

#include <cassert>
#include <iostream>
#include <ranges>
 
int main()
{
    static constexpr auto data = {0, -1, -2, 3, 1, 4, 1, 5}; 
    auto view = std::ranges::drop_while_view{data, [](int x) { return x <= 0; }};
    assert(view.end()[-1] == 5);
}

See also

begin
returns an iterator to the beginning
(public member function)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/ranges/drop_while_view/end

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API