[range.owning.view]

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

## 25.7 Range adaptors [[range.adaptors]](range.adaptors#range.owning.view)

### 25.7.6 All view [[range.all]](range.all#range.owning.view)

#### 25.7.6.3 Class template owning_view [range.owning.view]

[1](#1)

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

owning_view is a move-only view
of the elements of some other range[.](#1.sentence-1)

[ð](#lib:owning_view)

namespace std::ranges {template<[range](range.range#concept:range "25.4.2 Ranges [range.range]") R>requires [movable](concepts.object#concept:movable "18.6 Object concepts [concepts.object]")<R> && (!*is-initializer-list*<R>) // see [[range.refinements]](range.refinements "25.4.6 Other range refinements")class owning_view : public view_interface<owning_view<R>> {private: R *r_* = R(); // *exposition only*public: owning_view() requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")<R> = default; constexpr owning_view(R&& t);

 owning_view(owning_view&&) = default;
 owning_view& operator=(owning_view&&) = default; constexpr R& base() & noexcept { return *r_*; }constexpr const R& base() const & noexcept { return *r_*; }constexpr R&& base() && noexcept { return std::move(*r_*); }constexpr const R&& base() const && noexcept { return std::move(*r_*); }constexpr iterator_t<R> begin() { return ranges::begin(*r_*); }constexpr sentinel_t<R> end() { return ranges::end(*r_*); }constexpr auto begin() const requires [range](range.range#concept:range "25.4.2 Ranges [range.range]")<const R>{ return ranges::begin(*r_*); }constexpr auto end() const requires [range](range.range#concept:range "25.4.2 Ranges [range.range]")<const R>{ return ranges::end(*r_*); }constexpr bool empty() requires requires { ranges::empty(*r_*); }{ return ranges::empty(*r_*); }constexpr bool empty() const requires requires { ranges::empty(*r_*); }{ return ranges::empty(*r_*); }constexpr auto size() requires [sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<R>{ return ranges::size(*r_*); }constexpr auto size() const requires [sized_range](range.sized#concept:sized_range "25.4.4 Sized ranges [range.sized]")<const R>{ return ranges::size(*r_*); }constexpr auto reserve_hint() requires [approximately_sized_range](range.approximately.sized#concept:approximately_sized_range "25.4.3 Approximately sized ranges [range.approximately.sized]")<R>{ return ranges::reserve_hint(*r_*); }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 R>{ return ranges::reserve_hint(*r_*); }constexpr auto data() requires [contiguous_range](range.refinements#concept:contiguous_range "25.4.6 Other range refinements [range.refinements]")<R>{ return ranges::data(*r_*); }constexpr auto data() const requires [contiguous_range](range.refinements#concept:contiguous_range "25.4.6 Other range refinements [range.refinements]")<const R>{ return ranges::data(*r_*); }};}

[ð](#lib:owning_view,constructor)

`constexpr owning_view(R&& t);
`

[2](#2)

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

*Effects*: Initializes *r_* with std​::​move(t)[.](#2.sentence-1)
