std::ranges::views::to_input, std::ranges::to_input_view
<ranges>
requires ranges::view <V>
class to_input_view
inline constexpr /* unspecified */ to_input = /* unspecified */;
requires /* see below */
view as an input_range-only and not a common_range.- views::all (e), if it is a well-formed expression and all of the conditions below are true:
-
Tmodelsinput_range, -
Tdoes not satisfycommon_range, and -
Tdoes not satisfyforward_range.
-
- to_input_view{e} otherwise.
Consequently, to_input_view never models range concepts that are stronger than input_range. In particular, it does not model all of these:
Additionally, to_input_view does not model common_range. However, it does model borrowed_range, constant_range, and sized_range when the underlying view V models respective concepts.
Contents
[edit] Data members
V base_ (private)
the underlying view(exposition-only member object*)
[edit] Member functions
sized_range. (public member function)
Inherited from std::ranges::view_interface
sized_range or forward_range (public member function of
std::ranges::view_interface<D>) [edit]
(public member function of
std::ranges::view_interface<D>) [edit]
(public member function of
std::ranges::view_interface<D>) [edit]
(public member function of
std::ranges::view_interface<D>) [edit]
contiguous_iterator (public member function of
std::ranges::view_interface<D>) [edit]
forward_range (public member function of
std::ranges::view_interface<D>) [edit]
bidirectional_range and common_range (public member function of
std::ranges::view_interface<D>) [edit]
nth element in the derived view, provided only if it satisfies random_access_range (public member function of
std::ranges::view_interface<D>) [edit]
std::ranges::to_input_view::to_input_view
base_ via its default member initializer (= V()).base_ with std::move(base).Parameters
std::ranges::to_input_view::base
std::ranges::to_input_view::begin
std::ranges::to_input_view::end
std::ranges::to_input_view::size
[edit] Deduction guides
to_input_view( R&& ) -> to_input_view<views::all_t <R>>;
[edit] Nested classes
[edit] Helper templates
constexpr bool enable_borrowed_range<std::ranges::to_input_view<T>> =
This specialization of std::ranges::enable_borrowed_range makes to_input_view satisfy borrowed_range when the underlying view satisfies it.
[edit] Notes
to_input_view can be useful to avoid the overhead necessary to provide support for the operations needed for greater iterator strength.
| Feature-test macro | Value | Std | Feature |
|---|---|---|---|
__cpp_lib_ranges_to_input |
202502L |
(C++26) | std::ranges::to_input_view
|
[edit] Example
Reason: no example