e)
< T  >> is incomplete, then the call to ` ranges::data ` is ill-formed, no
diagnostic required.

If the argument is an lvalue or  [ 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
true  , a call to ` ranges::data ` is [ expression-equivalent
](/w/cpp/language/expressions#Expression-equivalence
"cpp/language/expressions") to:

  1. [ ` _decay-copy_ ` ](/w/cpp/standard_library/decay-copy "cpp/standard library/decay-copy") (  t.  data  (  )  )  (until C++23)  auto  (  t.  data  (  )  )  (since C++23)  , if that expression is valid and its type is a pointer to an object type. 
  2. Otherwise,  [ std::  to_address  ](http://en.cppreference.com/w/cpp/memory/to_address) (  [ ranges::  begin  ](http://en.cppreference.com/w/cpp/ranges-ranges-placeholder/begin) (  t  )  )  , if the expression  [ ranges::  begin  ](http://en.cppreference.com/w/cpp/ranges-ranges-placeholder/begin) (  t  )  is valid and its type models  [ std::contiguous_iterator ](/w/cpp/iterator/contiguous_iterator "cpp/iterator/contiguous iterator") . 

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

##  Contents

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

  
---  
  
###  Customization point objects

The name ` ranges::data ` 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 ` ___data_fn_ ` .

All instances of ` ___data_fn_ ` are equal. The effects of invoking different
instances of type ` ___data_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::data ` 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::data ` above, ` ___data_fn_ `
models  

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

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

###  [ [ edit ](/mwiki/index.php?title=cpp/ranges/data&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  , the call to ` ranges::data ` is ill-formed, which also results in
substitution failure.

If  [ ranges::  data  ](http://en.cppreference.com/w/cpp/ranges-ranges-
placeholder/data) (  e  )  is valid for an expression  e  , then it returns a
pointer to an object.

The C++20 standard requires that if the underlying ` data ` function call
returns a prvalue, the return value is move-constructed from the m