15 #ifndef RANGES_V3_VIEW_LINEAR_DISTRIBUTE_HPP
16 #define RANGES_V3_VIEW_LINEAR_DISTRIBUTE_HPP
18 #include <type_traits>
25 #include <range/v3/utility/static_const.hpp>
28 #include <range/v3/detail/prologue.hpp>
40 CPP_assert(std::is_arithmetic<T>());
50 constexpr T read()
const noexcept
60 bool const eq = n_ == other.n_;
61 RANGES_DIAGNOSTIC_PUSH
62 RANGES_DIAGNOSTIC_IGNORE_FLOAT_EQUAL
63 RANGES_EXPECT(to_ == other.to_);
64 RANGES_EXPECT(!eq || from_ == other.from_);
68 constexpr
void next() noexcept
70 RANGES_EXPECT(n_ > 0);
78 from_ = T(to_ - (delta_ * Calc(n_ - 1)));
87 , delta_(n > 1 ? (to - from) / Calc(n - 1) : 0)
90 RANGES_EXPECT(n_ > 0);
91 RANGES_EXPECT(to_ >= from_);
107 template(
typename T)(
108 requires std::is_arithmetic<T>::value)
109 constexpr
auto operator()(T from, T to, std::ptrdiff_t n)
const
121 #include <range/v3/detail/epilogue.hpp>
RANGES_INLINE_VARIABLE(detail::to_container_fn< detail::from_range< std::vector >>, to_vector) template< template< typename... > class ContT > auto to(RANGES_HIDDEN_DETAIL(detail
For initializing a container of the specified type with the elements of an Range.
Definition: conversion.hpp:399
std::integral_constant< std::size_t, N > size_t
An integral constant wrapper for std::size_t.
Definition: meta.hpp:163
typename detail::_cond< If >::template invoke< Then, Else > conditional_t
Select one type or another depending on a compile-time Boolean.
Definition: meta.hpp:1148
Definition: default_sentinel.hpp:26
A utility for constructing a view from a (derived) type that implements begin and end cursors.
Definition: facade.hpp:66
Distributes n values linearly in the closed interval [from, to].
Definition: linear_distribute.hpp:106
Definition: linear_distribute.hpp:39