24 Ranges library [ranges]

24.7 Range adaptors [range.adaptors]

24.7.11 Reverse view [range.reverse]

24.7.11.3 view​::​reverse [range.reverse.adaptor]

The name view::reverse denotes a range adaptor object.
For some subexpression E, the expression view::reverse(E) is expression-equivalent to:
  • If the type of E is a (possibly cv-qualified) specialization of reverse_­view, equivalent to E.base().
  • Otherwise, if the type of E is cv-qualified
    subrange<reverse_iterator<I>, reverse_iterator<I>, K>
    
    for some iterator type I and value K of type subrange_­kind,
    • if K is subrange_­kind::sized, equivalent to:
      subrange<I, I, K>(E.end().base(), E.begin().base(), E.size())
      
    • otherwise, equivalent to:
      subrange<I, I, K>(E.end().base(), E.begin().base())
      
    However, in either case E is evaluated only once.
  • Otherwise, equivalent to reverse_­view{E}.