cpp/ranges/as const view

@1@ A range adaptor that represents a view of underlying that is also a. An always has read-only elements (if not empty).

@2@ . Let be a subexpression, let  be, and let  be. Then the expression is expression-equivalent to:
 * , if it is a well-formed expression and models ;
 * otherwise, for some type  and some extent  if  denotes ;
 * otherwise, if  denotes  for some type  and  models ;
 * otherwise, if  is an lvalue,  models, and  does not model.
 * otherwise,.

always models, and it models the , , , , , , and when the underlying view  models respective concepts.

Data members
Typical implementations of only hold one non-static data member:
 * the underlying view of type (shown here as, the name is exposition only).

Member functions
{{member|{{small|std::ranges::as_const_view::}}as_const_view| {{dcl begin}} {{dcl|num=1|since=c++23|1= as_const_view requires std::default_initializable = default; }} {{dcl|num=2|since=c++23| constexpr explicit as_const_view( V base ); }} {{dcl end}}

@1@ Value-initializes {{tti|base_}} via its default member initializer ({{c|1== V}}). @2@ Initializes {{tti|base_}} with {{c|std::move(base)}}.

Parameters
}}

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