Spec-Zone.ru › C++

std::ranges::iota_view<W, Bound>::end

constexpr auto end() const;
(1) (начиная с C++20)
constexpr /*iterator*/ end() const requires std::same_as<W, Bound>;
(2) (начиная с C++20)
1) Получает sentinel, представляющий значение sentinel:
  • Если Bound — std::unreachable_sentinel_t, возвращает std::unreachable_sentinel.
  • В противном случае возвращает sentinel {bound_ }.
2) Получает итератор к значению sentinel.

Возвращаемое значение

1) Как указано выше.
2) iterator {bound_ }

Пример

#include <iostream>
#include <ranges>

int main()
{
    auto iota{std::views::iota(2, 6)};
    auto end{iota.end()};
    for (auto iter{iota.begin()}; iter != end; ++iter)
        std::cout << *iter << ' ';
    std::cout << '\n';
}

Вывод:

2 3 4 5

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

Spec-Zone.ru

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