[range.to.input.view]

# 25 Ranges library [[ranges]](./#ranges)

## 25.7 Range adaptors [[range.adaptors]](range.adaptors#range.to.input.view)

### 25.7.35 To input view [[range.to.input]](range.to.input#view)

#### 25.7.35.2 Class template to_input_view [range.to.input.view]

[ð](#lib:to_input_view)

namespace std::ranges {template<[input_range](range.refinements#concept:input_range "25.4.6 Other range refinements [range.refinements]") V>requires [view](range.view#concept:view "25.4.5 Views [range.view]")<V>class to_input_view : public view_interface<to_input_view<V>> { V *base_* = V(); // *exposition only*// [[range.to.input.iterator]](range.to.input.iterator "25.7.35.3 Class template to_­input_­view​::​iterator"), class template to_input_view​::​*iterator*template<bool Const> class *iterator*; // *exposition only*public: to_input_view() requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")<V> = default; constexpr explicit to_input_view(V base); constexpr V base() const & requires [copy_constructible](concept.copyconstructible#concept:copy_constructible "18.4.14 Concept copy_­constructible [concept.copyconstructible]")<V> { return *base_*; }constexpr V base() && { return std::move(*base_*); }constexpr auto begin() requires (![*simple-view*](range.utility.helpers#concept:simple-view "25.5.2 Helper concepts [range.utility.helpers]")<V>); constexpr auto begin() const requires [range](range.range#concept:range "25.4.2 Ranges [range.range]")<const V>; constexpr auto end() requires (![*simple-view*](range.utility.helpers#concept:simple-view "25.5.2 Helper concepts [range.utility.helpers]")<V>); constexpr auto end() const requires [range](range.range#concept:range "25.4.2 Ranges [range.range]")<const V>; constexpr auto size() requires [sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<V>; constexpr auto size() const requires [sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<const V>; constexpr auto reserve_hint() requires [approximately_sized_range](range.approximately.sized#concept:approximately_sized_range "25.4.3 Approximately sized ranges [range.approximately.sized]")<V>; constexpr auto reserve_hint() const requires [approximately_sized_range](range.approximately.sized#concept:approximately_sized_range "25.4.3 Approximately sized ranges [range.approximately.sized]")<const V>; }; template<class R> to_input_view(R&&) -> to_input_view<views::all_t<R>>;}

[ð](#lib:to_input_view,constructor)

`constexpr explicit to_input_view(V base);
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L17790)

*Effects*: Initializes *base_* with std​::​move(base)[.](#1.sentence-1)

[ð](#lib:begin,to_input_view)

`constexpr auto begin() requires (![simple-view](range.utility.helpers#concept:simple-view "25.5.2 Helper concepts [range.utility.helpers]")<V>);
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L17801)

*Effects*: Equivalent to: return *iterator*<false>(ranges​::​begin(*base_*));

[ð](#lib:begin,to_input_view_)

`constexpr auto begin() const requires [range](range.range#concept:range "25.4.2 Ranges [range.range]")<const V>;
`

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L17812)

*Effects*: Equivalent to: return *iterator*<true>(ranges​::​begin(*base_*));

[ð](#lib:end,to_input_view)

`constexpr auto end() requires (![simple-view](range.utility.helpers#concept:simple-view "25.5.2 Helper concepts [range.utility.helpers]")<V>);
constexpr auto end() const requires [range](range.range#concept:range "25.4.2 Ranges [range.range]")<const V>;
`

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L17824)

*Effects*: Equivalent to: return ranges​::​end(*base_*);

[ð](#lib:size,to_input_view)

`constexpr auto size() requires [sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<V>;
constexpr auto size() const requires [sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<const V>;
`

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L17836)

*Effects*: Equivalent to: return ranges​::​size(*base_*);

[ð](#lib:reserve_hint,to_input_view)

`constexpr auto reserve_hint() requires [approximately_sized_range](range.approximately.sized#concept:approximately_sized_range "25.4.3 Approximately sized ranges [range.approximately.sized]")<V>;
constexpr auto reserve_hint() const requires [approximately_sized_range](range.approximately.sized#concept:approximately_sized_range "25.4.3 Approximately sized ranges [range.approximately.sized]")<const V>;
`

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L17848)

*Effects*: Equivalent to: return ranges​::​reserve_hint(*base_*);
