|
3055 | 3055 | a range adaptor closure object \tcode{C} and an expression \tcode{R} such that
|
3056 | 3056 | \tcode{decltype((R))} models \libconcept{viewable_range}, the following
|
3057 | 3057 | expressions are equivalent and yield a \libconcept{view}:
|
3058 |
| - |
3059 | 3058 | \begin{codeblock}
|
3060 | 3059 | C(R)
|
3061 | 3060 | R | C
|
3062 | 3061 | \end{codeblock}
|
3063 |
| - |
3064 | 3062 | Given an additional range adaptor closure object \tcode{D},
|
3065 |
| -the expression \tcode{C | D} is well-formed and produces another range adaptor |
3066 |
| -closure object such that the following two expressions are equivalent: |
3067 |
| - |
3068 |
| -\begin{codeblock} |
3069 |
| -R | C | D |
3070 |
| -R | (C | D) |
3071 |
| -\end{codeblock} |
| 3063 | +the expression \tcode{C | D} produces another range adaptor |
| 3064 | +closure object \tcode{E}. |
| 3065 | +\tcode{E} is a perfect forwarding call wrapper\iref{func.require} |
| 3066 | +with the following properties: |
| 3067 | +\begin{itemize} |
| 3068 | +\item |
| 3069 | +Its target object is an object \tcode{d} of type \tcode{decay_t<decltype((D))>} |
| 3070 | +direct-non-list-initialized with \tcode{D}. |
| 3071 | +\item |
| 3072 | +It has one bound argument entity, |
| 3073 | +an object \tcode{c} of type \tcode{decay_t<decltype((C))>} |
| 3074 | +direct-non-list-initialized with \tcode{C}. |
| 3075 | +\item |
| 3076 | +Its call pattern is \tcode{d(c(arg))}, |
| 3077 | +where \tcode{arg} is the argument used in |
| 3078 | +a function call expression of \tcode{E}. |
| 3079 | +\end{itemize} |
| 3080 | +The expression \tcode{C | D} is well-formed if and only if |
| 3081 | +the initializations of the state entities of \tcode{E} are all well-formed. |
3072 | 3082 |
|
3073 | 3083 | \pnum
|
3074 | 3084 | A \term{range adaptor object} is a
|
|
3081 | 3091 | then it is a range adaptor closure object.
|
3082 | 3092 |
|
3083 | 3093 | \pnum
|
3084 |
| -If a range adaptor object accepts more than one argument, |
3085 |
| -then the following expressions are equivalent: |
3086 |
| - |
3087 |
| -\begin{codeblock} |
3088 |
| -@\placeholdernc{adaptor}@(range, args...) |
3089 |
| -@\placeholdernc{adaptor}@(args...)(range) |
3090 |
| -range | @\placeholdernc{adaptor}@(args...) |
3091 |
| -\end{codeblock} |
3092 |
| - |
3093 |
| -In this case, \tcode{\placeholdernc{adaptor}(args...)} is a range adaptor |
3094 |
| -closure object. |
| 3094 | +If a range adaptor object \tcode{adaptor} accepts more than one argument, |
| 3095 | +then let \tcode{range} be an expression |
| 3096 | +such that \tcode{decltype((range))} models \libconcept{viewable_range}, |
| 3097 | +let \tcode{args...} be arguments |
| 3098 | +such that \tcode{adaptor(range, args...)} is a well-formed expression |
| 3099 | +as specified in the rest of subclause\iref{range.adaptors}, and |
| 3100 | +let \tcode{BoundArgs} be a pack |
| 3101 | +that denotes \tcode{decay_t<decltype((args))>...}. |
| 3102 | +The expression \tcode{adaptor(args...)} produces a range adaptor closure object \tcode{f} |
| 3103 | +that is a perfect forwarding call wrapper with the following properties: |
| 3104 | +\begin{itemize} |
| 3105 | +\item |
| 3106 | +Its target object is a copy of \tcode{adaptor}. |
| 3107 | +\item |
| 3108 | +Its bound argument entities \tcode{bound_args} consist of objects of types \tcode{BoundArgs...} direct-non-list-initialized with \tcode{std::forward<decltype((args))>(args)...}, respectively. |
| 3109 | +\item |
| 3110 | +Its call pattern is \tcode{adaptor(r, bound_args...)}, |
| 3111 | +where \tcode{r} is the argument used in a function call expression of \tcode{f}. |
| 3112 | +\end{itemize} |
| 3113 | +The expression \tcode{adaptor(args...)} is well-formed if and only if |
| 3114 | +the initialization of the bound argument entities of the result, |
| 3115 | +as specified above, are all well-formed. |
3095 | 3116 |
|
3096 | 3117 | \rSec2[range.semi.wrap]{Semiregular wrapper}
|
3097 | 3118 |
|
|
0 commit comments