Range-v3
Range algorithms, views, and actions for the Standard Library
ranges::views::ints_fn Struct Reference

#include <range/v3/view/iota.hpp>

+ Inheritance diagram for ranges::views::ints_fn:

Public Member Functions

template<typename Val >
requires integral<Val>
constexpr iota_view< Val, Val > operator() (Val from, Val to) const
 
template<typename Val >
requires integral<Val>
constexpr iota_view< Val > operator() (Val value) const
 
template<typename Val >
requires integral<Val>
constexpr iota_view< Val > operator() (Val value, unreachable_sentinel_t) const
 
- Public Member Functions inherited from ranges::iota_view< int >
constexpr iota_view (int from)
 
constexpr iota_view (meta::id_t< int > from, meta::id_t< To > to)
 
- Public Member Functions inherited from ranges::view_facade< iota_view< int, To >, same_as< To, unreachable_sentinel_t > ? infinite :std::is_integral< int >::value &&std::is_integral< To >::value ? finite :unknown >
constexpr auto begin () -> detail::facade_iterator_t< D >
 Let d be static_cast<Derived &>(*this). Let b be std::as_const(d).begin_cursor() if that expression is well-formed; otherwise, let b be d.begin_cursor(). Let B be the type of b. More...
 
constexpr auto begin () const -> detail::facade_iterator_t< D const >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
constexpr auto end () -> detail::facade_sentinel_t< D >
 Let d be static_cast<Derived &>(*this). Let e be std::as_const(d).end_cursor() if that expression is well-formed; otherwise, let e be d.end_cursor(). Let E be the type of e. More...
 
constexpr auto end () const -> detail::facade_sentinel_t< D const >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
- Public Member Functions inherited from ranges::view_interface< iota_view< int, To >, Cardinality >
constexpr auto empty () const noexcept -> bool
 Test whether a range can be empty:
 
&&!detail ::has_fixed_size_< Cardinality > &&forward_range< D< True > const > constexpr bool empty () const noexcept(noexcept(bool(ranges::begin(std::declval< D< True > const & >())==ranges::end(std::declval< D< True > const & >()))))
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
&&Cardinality< 0) &&(Cardinality !=infinite) &&(!forward_range< D< True > >) &&sized_range< D< True > > constexpr bool empty() noexcept(noexcept(bool(ranges::size(std::declval< D< True > & >())==0))) { return ranges::size(derived())==0;} template< bool True=true > &&Cardinality< 0) &&(Cardinality !=infinite) &&(!forward_range< D< True > const >) &&sized_range< D< True > const > constexpr bool empty() const noexcept(noexcept(bool(ranges::size(std::declval< D< True > const & >())==0))) { return ranges::size(derived())==0;} template< bool True=true > &&!detail ::has_fixed_size_< Cardinality > &&forward_range< D< True > > constexpr bool empty () noexcept(noexcept(bool(ranges::begin(std::declval< D< True > & >())==ranges::end(std::declval< D< True > & >()))))
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
&&detail::can_empty_< D< True > const > constexpr operator bool () const noexcept(noexcept(ranges::empty(std::declval< D< True > const & >())))
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
&&detail::can_empty_< D< True > > constexpr operator bool () noexcept(noexcept(ranges::empty(std::declval< D< True > & >())))
 
view_interfaceoperator= (view_interface &&)=default
 
view_interfaceoperator= (view_interface const &)=default
 
 view_interface (view_interface &&)=default
 
 view_interface (view_interface const &)=default
 

Related Functions

(Note that these are not member functions.)

constexpr ints_fn ints {}
 

Additional Inherited Members

- Protected Types inherited from ranges::view_interface< iota_view< int, To >, Cardinality >
using D = meta::invoke< detail::dependent_< B >, iota_view< int, To > >
 
- Protected Member Functions inherited from ranges::view_facade< iota_view< int, To >, same_as< To, unreachable_sentinel_t > ? infinite :std::is_integral< int >::value &&std::is_integral< To >::value ? finite :unknown >
constexpr view_as_cursor begin_cursor () const
 
constexpr default_sentinel_t end_cursor () const
 
- Protected Member Functions inherited from ranges::view_interface< iota_view< int, To >, Cardinality >
constexpr iota_view< int, To > const & derived () const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
constexpr iota_view< int, To > & derived () noexcept
 
- Protected Attributes inherited from ranges::view_facade< iota_view< int, To >, same_as< To, unreachable_sentinel_t > ? infinite :std::is_integral< int >::value &&std::is_integral< To >::value ? finite :unknown >
friend range_access
 

Detailed Description

ranges::views::ints

The ints view returns a range of monotonically increasing ints.

Example

#include <iostream>
#include <vector>
int main()
{
auto numbers = ranges::views::ints(3, 7);
std::cout << numbers << '\n';
}

Output

[3,4,5,6]

Syntax

auto output_range = ranges::views::ints(lower_bound, upper_bound);
The output_range concept.
Definition: concepts.hpp:88
constexpr I upper_bound(I first, S last, V const &val, C pred=C{}, P proj=P{})
function template upper_bound
Definition: upper_bound.hpp:43
constexpr I lower_bound(I first, S last, V const &val, C pred=C{}, P proj=P{})
function template lower_bound
Definition: lower_bound.hpp:45

Parameters

lower_bound
  • Optional lower bound
upper_bound
  • Exclusive upper bound
  • Required when lower_bound is specified
    • To create an infinite range with a lower_bound, use ranges::unreachable as the upper_bound
output_range
  • Range of monotonically increasing ints
  • When an upper_bound is not specified, the range is quasi-infinite