) < [ std::
remove_cv_t  ](http://en.cppreference.com/w/cpp/types/remove_cv) < T  >> is
true  , then a call to ` ranges::end ` is [ expression-equivalent
](/w/cpp/language/expressions#Expression-equivalence
"cpp/language/expressions") to:

  1. t  \+  [ std::  extent_v  ](http://en.cppreference.com/w/cpp/types/extent) < T  > if  t  has an array type of known bound. 
     * If  [ std::  remove_all_extents_t  ](http://en.cppreference.com/w/cpp/types/remove_all_extents) < [ std::  remove_reference_t  ](http://en.cppreference.com/w/cpp/types/remove_reference) < T  >> is incomplete, then the call to ` ranges::end ` is ill-formed, [ no diagnostic required ](/w/cpp/language/ndr "cpp/language/ndr") . 
  2. Otherwise,  [ ` _decay-copy_ ` ](/w/cpp/standard_library/decay-copy "cpp/standard library/decay-copy") (  t.  end  (  )  )  (until C++23)  auto  (  t.  end  (  )  )  (since C++23)  , if that expression is valid, and its type models  [ std::  sentinel_for  ](http://en.cppreference.com/w/cpp/iterator/sentinel_for) < [ ranges::  iterator_t  ](http://en.cppreference.com/w/cpp/ranges-ranges-placeholder/iterator_t) < T  >> . 
  3. Otherwise,  [ ` _decay-copy_ ` ](/w/cpp/standard_library/decay-copy "cpp/standard library/decay-copy") (  end  (  t  )  )  (until C++23)  auto  (  end  (  t  )  )  (since C++23)  , if ` T ` is a class or enumeration type, that expression is valid and its converted type models  [ std::  sentinel_for  ](http://en.cppreference.com/w/cpp/iterator/sentinel_for) < [ ranges::  iterator_t  ](http://en.cppreference.com/w/cpp/ranges-ranges-placeholder/iterator_t) < T  >> , where the meaning of ` end ` is established as if by performing [ argument-dependent lookup ](/w/cpp/language/adl "cpp/language/adl") only. 

In all other cases, a call to ` ranges::end ` is ill-formed, which can result
in [ substitution failure ](/w/cpp/language/sfinae "cpp/language/sfinae") when
the call to ` ranges::end ` appears in the immediate context of a template
instantiation.

##  Contents

  * 1  Customization point objects 
  * 2  Notes 
  * 3  Example 
  * 4  Defect reports 
  * 5  See also 

  
---  
  
###  Customization point objects

The name ` ranges::end ` denotes a _customization point object_ , which is a
const [ function object ](/w/cpp/named_req/FunctionObject "cpp/named
req/FunctionObject") of a [ literal ](/w/cpp/named_req/LiteralType "cpp/named
req/LiteralType") [ ` semiregular ` ](/w/cpp/concepts/semiregular
"cpp/concepts/semiregular") class type. For exposition purposes, the cv-
unqualified version of its type is denoted as ` ___end_fn_ ` .

All instances of ` ___end_fn_ ` are equal. The effects of invoking different
instances of type ` ___end_fn_ ` on the same arguments are equivalent,
regardless of whether the expression denoting the instance is an lvalue or
rvalue, and is const-qualified or not (however, a volatile-qualified instance
is not required to be invocable). Thus, ` ranges::end ` can be copied freely
and its copies can be used interchangeably.

Given a set of types ` Args... ` , if  [ std::  declval
](http://en.cppreference.com/w/cpp/utility/declval) < Args  > (  )  ...  meet
the requirements for arguments to ` ranges::end ` above, ` ___end_fn_ ` models  

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

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

###  [ [ edit ](/mwiki/index.php?title=cpp/ranges/end&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.cppreferenc