Namespaces
Variants

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

De fr.cppreference.net
 
 
Bibliothèque de ranges
Adaptateurs de ranges
 
 
constexpr auto end() const;
(1) (depuis C++20)
constexpr /*iterator*/ end() const requires std::same_as<W, Bound>;
(2) (depuis C++20)
1) Obtient une sentinel représentant la valeur sentinelle :
  • Si Bound est std::unreachable_sentinel_t, retourne std::unreachable_sentinel.
  • Sinon, retourne sentinel {bound_ }.
2) Obtient un iterator vers la valeur sentinelle.

Valeur de retour

1) Comme spécifié ci-dessus.
2) iterator  { bound_  }

Exemple

#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';
}

Sortie :

2 3 4 5