, 
  * [ std::  invocable  ](http://en.cppreference.com/w/cpp/concepts/invocable) < const  __rend_fn, Args...  > , 
  * [ std::  invocable  ](http://en.cppreference.com/w/cpp/concepts/invocable) < __rend_fn  & , Args...  > , and 
  * [ std::  invocable  ](http://en.cppreference.com/w/cpp/concepts/invocable) < const  __rend_fn  & , Args...  > .   

Otherwise, no function call operator of ` ___rend_fn_ ` participates in
overload resolution.

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

If the argument is an rvalue (i.e. ` T ` is an object type) and  [ ranges::
enable_borrowed_range
](http://en.cppreference.com/w/cpp/ranges/borrowed_range) < [ std::
remove_cv_t  ](http://en.cppreference.com/w/cpp/types/remove_cv) < T  >> is
false  , or if it is of an array type of unknown bound, the call to `
ranges::rend ` is ill-formed, which also results in substitution failure.

If  ranges  ::  rend  (  [ std::  forward
](http://en.cppreference.com/w/cpp/utility/forward) < T  > (  t  )  )  is
valid, then  decltype  (  ranges  ::  rend  (  [ std::  forward
](http://en.cppreference.com/w/cpp/utility/forward) < T  > (  t  )  )  )  and
decltype  (  [ ranges::  begin  ](http://en.cppreference.com/w/cpp/ranges-
ranges-placeholder/begin) (  [ std::  forward
](http://en.cppreference.com/w/cpp/utility/forward) < T  > (  t  )  )  )
model  [ std::sentinel_for ](/w/cpp/iterator/sentinel_for
"cpp/iterator/sentinel for") in all cases, while ` T ` models  [
std::ranges::range ](/w/cpp/ranges/range "cpp/ranges/range") .

The C++20 standard requires that if the underlying ` rend ` function call
returns a prvalue, the return value is move-constructed from the materialized
temporary object. All implementations directly return the prvalue instead. The
requirement is corrected by the post-C++20 proposal [ P0849R8
](https://wg21.link/P0849R8) to match the implementations.

###  [ [ edit ](/mwiki/index.php?title=cpp/ranges/rend&action=edit&section=2
"Edit section: Example") ]  Example

Run this code

    
    
    #include <algorithm>
    #include <iostream>
    #include <ranges>
    #include <vector>
     
    int main()
    {
        [std::vector](http://en.cppreference.com/w/cpp/container/vector)<int> v = {3, 1, 4};
        namespace ranges = std::ranges;
        if ([ranges::find](http://en.cppreference.com/w/cpp/algorithm/ranges/find)([ranges::rbegin](http://en.cppreference.com/w/cpp/ranges/rbegin)(v), ranges::rend(v), 5) != ranges::rend(v))
            [std::cout](http://en.cppreference.com/w/cpp/io/cout) << "found a 5 in vector v!\n";
     
        int a[] = {5, 10, 15};
        if ([ranges::find](http://en.cppreference.com/w/cpp/algorithm/ranges/find)([ranges::rbegin](http://en.cppreference.com/w/cpp/ranges/rbegin)(a), ranges::rend(a), 5) != ranges::rend(a))
            [std::cout](http://en.cppreference.com/w/cpp/io/cout) << "found a 5 in array a!\n";
    }

Output:

    
    
    found a 5 in array a!

###  [ [ edit ](/mwiki/index.php?title=cpp/ranges/rend&action=edit&section=3
"Edit section: Defect reports") ]  Defect reports

The following behavior-changing defect reports were applied retroactively to
previously published C++ standards.

DR  |  Applied to  |  Behavior as published  |  Correct behavior   
---|---|---|---  
[ P2602R2 ](https://wg21.link/P2602R2) |  C++20  |  there's machinery to prohibit certain non-member ` rend ` found by [ ADL ](/w/cpp/language/adl "cpp/language/adl") |  removed such machinery   
  
###  [ [ edit ](/mwiki/index.php?title=cpp/ranges/rend&action=edit&section=4
"Edit section: See also") ]  See also

[ ranges::crend  ](/w/cpp/ranges/crend "cpp/ranges/crend") (C++20)  |  returns a reverse end iterator to a read-only range   
(customization point object)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/dsc_crend&action=edit)  
---|---  
[ ranges::rbegin  ](/w/cpp/ranges/rbegin "cpp/ranges/rbegin") (C++20)  |  returns a reverse