cpp/ranges/owning view

is a that has unique ownership of a. It is move-only and stores that within it.

The constant in the requires-clause is  if and only if  is a specialization of std.

Data members
Typical implementations of have only one non-static data member: the underlying range of type. The member is shown as here (the name is exposition-only).

Member functions
{{member|{{small|std::ranges::owning_view::}}owning_view|2= {{dcl begin}} {{dcl|num=1|since=c++20|1= owning_view requires std::default_initializable = default; }} {{dcl|num=2|since=c++20|1= owning_view( owning_view&& other ) = default; }} {{dcl|num=3|since=c++20|1= constexpr owning_view( R&& t ); }} {{dcl|num=4|since=c++20|1= owning_view( const owning_view& ) = delete; }} {{dcl end}}

@1@ Default constructor. Value-initializes the stored range by its default member initializer ({{c|1== R}}).

@2@ Move constructor. Move constructs the stored range from that of {{tt|other}}.

@3@ Move constructs the stored range from {{tt|t}}.

@4@ Copy constructor is deleted. {{tt|owning_view}} is move-only.

Parameters
}}

{{member|{{small|std::ranges::owning_view::}}operator{{=}}| {{dcl begin}} {{dcl|num=1|since=c++20|1= owning_view& operator=( owning_view&& other ) = default; }} {{dcl|num=2|since=c++20|1= owning_view& operator=( const owning_view& ) = delete; }} {{dcl end}}

@1@ Move assignment operator. Move assigns the stored range from that of {{tt|other}}.

@2@ Copy assignment operator is deleted. {{tt|owning_view}} is move-only.

Return value
. }}

Helper templates
This specialization of makes  satisfy  when the underlying range satisfies it.