D> ` )  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/view_interface/dsc_back&action=edit)  
[ operator[]  ](/w/cpp/ranges/view_interface/operator_at "cpp/ranges/view interface/operator at") (C++20)  |  returns the n  th  element in the derived view. Provided if it satisfies [ ` random_access_range ` ](/w/cpp/ranges/random_access_range "cpp/ranges/random access range") .   
(public member function of ` std::ranges::view_interface<D> ` )  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/view_interface/dsc_operator_at&action=edit)  
  
##  std::ranges::ref_view::  ref_view

template  < /*different-from*/  < ref_view  > T  >  
requires [ std::  convertible_to
](http://en.cppreference.com/w/cpp/concepts/convertible_to) < T, R  & > &&
requires  {  _FUN  (  [ std::  declval
](http://en.cppreference.com/w/cpp/utility/declval) < T  > (  )  )  ;  }  
constexpr  ref_view  (  T  && t  )  ;  |  |  (since C++20)   
---|---|---  
|  |   
  
Initializes ` _r__ ` with  [ std::  addressof
](http://en.cppreference.com/w/cpp/memory/addressof) (  static_cast  < R  & >
(  [ std::  forward  ](http://en.cppreference.com/w/cpp/utility/forward) < T
> (  t  )  )  )  .

/*different-from*/  < T, U  > is satisfied if and only if  [ std::
remove_cvref_t  ](http://en.cppreference.com/w/cpp/types/remove_cvref) < T  >
and  [ std::  remove_cvref_t
](http://en.cppreference.com/w/cpp/types/remove_cvref) < U  > are not the same
type, and overloads of ` __FUN_ ` are declared as  void  _FUN  (  R  & )  ;
void  _FUN  (  R  && )  =  delete  ;  .

###  Parameters

t  |  \-  |  range to reference   
---|---|---  
  
##  std::ranges::ref_view::  base

constexpr  R  & base  (  )  const  ;  |  |  (since C++20)   
---|---|---  
|  |   
  
Equivalent to  return  *  r_  ;  .

##  std::ranges::ref_view::  begin

constexpr  [ ranges::  iterator_t  ](http://en.cppreference.com/w/cpp/ranges-ranges-placeholder/iterator_t) < R  > begin  (  )  const  ;  |  |  (since C++20)   
---|---|---  
|  |   
  
Equivalent to  return  [ ranges::  begin
](http://en.cppreference.com/w/cpp/ranges-ranges-placeholder/begin) (  *  r_
)  ;  .

##  std::ranges::ref_view::  end

constexpr  [ ranges::  sentinel_t  ](http://en.cppreference.com/w/cpp/ranges-ranges-placeholder/iterator_t) < R  > end  (  )  const  ;  |  |  (since C++20)   
---|---|---  
|  |   
  
Equivalent to  return  [ ranges::  end
](http://en.cppreference.com/w/cpp/ranges-ranges-placeholder/end) (  *  r_  )
;  .

##  std::ranges::ref_view::  empty

constexpr  bool  empty  (  )  const  
requires requires  {  [ ranges::  empty  ](http://en.cppreference.com/w/cpp/ranges/empty) (  *  r_  )  ;  }  ;  |  |  (since C++20)   
---|---|---  
|  |   
  
Equivalent to  return  [ ranges::  empty
](http://en.cppreference.com/w/cpp/ranges/empty) (  *  r_  )  ;  .

##  std::ranges::ref_view::  size

constexpr  auto  size  (  )  const  
requires [ ranges::  sized_range  ](http://en.cppreference.com/w/cpp/ranges/sized_range) < R  > ;  |  |  (since C++20)   
---|---|---  
|  |   
  
Equivalent to  return  [ ranges::  size
](http://en.cppreference.com/w/cpp/ranges/size) (  *  r_  )  ;  .

##  std::ranges::ref_view::  data

constexpr  auto  data  (  )  const  
requires [ ranges::  contiguous_range  ](http://en.cppreference.com/w/cpp/ranges/contiguous_range) < R  > ;  |  |  (since C++20)   
---|---|---  
|  |   
  
Equivalent to  return  [ ranges::  data
](http://en.cppreference.com/w/cpp/ranges-ranges-placeholder/data) (  *  r_  )
;  .

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

template  < class  R  >  
ref_view  (  R  & )  \-  > ref_view  < R  > ;  |  |  (since C++20)   
---|---|---  
|  |   
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/ref_view&action=edit&section=5 "Edit
section: Helper templates") ]  Helper templates

template  < class  T  >  
inline  constexpr  bool  enable_borrowed_ra