e<D> ` )  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/view_interface/dsc_operator_at&action=edit)  
  
##  std::ranges::as_const_view::  as_const_view

as_const_view  (  )  requires [ std::  default_initializable  ](http://en.cppreference.com/w/cpp/concepts/default_initializable) < V  > =  default  ;  |  (1)  |  (since C++23)   
---|---|---  
constexpr  explicit  as_const_view  (  V base  )  ;  |  (2)  |  (since C++23)   
|  |   
  
1)  Value-initializes ` _base__ ` via its default member initializer (  =  V
(  )  ).

2)  Initializes ` _base__ ` with  std  ::  move  (  base  )  .

###  Parameters

base  |  \-  |  a view   
---|---|---  
  
##  std::ranges::as_const_view::  base

constexpr  V base  (  )  const  & requires [ std::  copy_constructible  ](http://en.cppreference.com/w/cpp/concepts/copy_constructible) < V  > ;  |  (1)  |  (since C++23)   
---|---|---  
constexpr  V base  (  )  && ;  |  (2)  |  (since C++23)   
|  |   
  
Returns the underlying view.

1)  Copy-constructs the result from the underlying view. Equivalent to  return
base_  ;  .

2)  Move-constructs the result from the underlying view. Equivalent to  return
std  ::  move  (  base_  )  ;  .

##  std::ranges::as_const_view::  begin

constexpr  auto  begin  (  )  requires  (  !  __simple_view  < V  > )  ;  |  (1)  |  (since C++23)   
---|---|---  
constexpr  auto  begin  (  )  const  requires [ ranges::  range  ](http://en.cppreference.com/w/cpp/ranges/range) < const  V  > ;  |  (2)  |  (since C++23)   
|  |   
  
Returns the constant iterator of the view.

1,2)  Equivalent to  return  [ ranges::  cbegin
](http://en.cppreference.com/w/cpp/ranges-ranges-placeholder/cbegin) (  base_
)  ;

##  std::ranges::as_const_view::  end

constexpr  auto  end  (  )  requires  (  !  __simple_view  < V  > )  ;  |  (1)  |  (since C++23)   
---|---|---  
constexpr  auto  end  (  )  const  requires [ ranges::  range  ](http://en.cppreference.com/w/cpp/ranges/range) < const  V  > ;  |  (2)  |  (since C++23)   
|  |   
  
Returns the constant sentinel of the view.

1,2)  Equivalent to  return  [ ranges::  cend
](http://en.cppreference.com/w/cpp/ranges-ranges-placeholder/cend) (  base_  )
;

##  std::ranges::as_const_view::  size

constexpr  auto  size  (  )  requires [ ranges::  sized_range  ](http://en.cppreference.com/w/cpp/ranges/sized_range) < V  > ;  |  (1)  |  (since C++23)   
---|---|---  
constexpr  auto  size  (  )  const  requires [ ranges::  sized_range  ](http://en.cppreference.com/w/cpp/ranges/sized_range) < const  V  > ;  |  (2)  |  (since C++23)   
|  |   
  
Returns the size of the view if the view is bounded.

1,2)  Equivalent to  return  [ ranges::  size
](http://en.cppreference.com/w/cpp/ranges/size) (  base_  )  ;

###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/as_const_view&action=edit&section=4 "Edit
section: Deduction guides") ]  Deduction guides

template  < class  R  >  
as_const_view  (  R  && )  \-  > as_const_view  < [ views::  all_t  ](http://en.cppreference.com/w/cpp/ranges/all_view) < R  >> ;  |  |  (since C++23)   
---|---|---  
|  |   
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/as_const_view&action=edit&section=5 "Edit
section: Helper templates") ]  Helper templates

template  < class  T  >  
inline  constexpr  bool  enable_borrowed_range  < std  ::  ranges  ::
as_const_view  < T  >> =  
std  ::  [ ranges::  enable_borrowed_range  ](http://en.cppreference.com/w/cpp/ranges/borrowed_range) < T  > ;  |  |  (since C++23)   
---|---|---  
|  |   
  
This specialization of [ ` std::ranges::enable_borrowed_range `
](/w/cpp/ranges/borrowed_range "cpp/ranges/borrowed range") makes `
as_const_view ` satisfy [ ` borrowed_range ` ](/w/cpp/ranges/borrowed_range
"cpp/ranges/borrowed range") when the underlying view satisfies it.

###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/as_const_view&action=edit&section=6 "Edit
section: Notes") ]  Notes

[ Feature-test ](/w/cpp/utility/feature_test "cpp/utility/feature