@@ -57,13 +57,21 @@ requires compilers to add new intrinsics when reflection is absent.
5757-2- Given a subexpression `E` with type `T`, let `t` be an lvalue that denotes the reified object for `E`. Then:
5858</p >
5959<ol style =" list-style-type: none" >
60- <li ><p >(2.1) — [… ]</p ></li >
61- <li ><p >(2.2) — [… ]</p ></li >
62- <li ><p >(2.3) — [… ]</p ></li >
63- <li ><p >(2.4) — [… ]</p ></li >
60+ <li ><p >(2.1) — If `E` is an rvalue and <tt >enable_borrowed_range< remove_cv_t< T>> </tt > is
61+ `false`, `ranges::begin(E)` is ill-formed.</p ></li >
62+ <li ><p >(2.2) — Otherwise, if `T` is an array type (<sref ref =" [dcl.array]" />) and
63+ <tt >remove_all_extents_t< T> </tt > is an incomplete type, `ranges::begin(E)` is
64+ ill-formed with no diagnostic required.</p ></li >
65+ <li ><p >(2.3) — Otherwise, if `T` is an array type, `ranges::begin(E)` is
66+ expression-equivalent to `t + 0`.</p ></li >
67+ <li ><p >(2.4) — Otherwise, if `auto(t.begin())` is a valid expression whose type models
68+ `input_or_output_iterator`, `ranges::begin(E)` is expression-equivalent to `auto(t.begin())`.</p ></li >
6469<li ><p ><ins >(2.?) — Otherwise, if <tt >remove_cvref_t< T> </tt > is a class type and search for
6570`begin` in the scope of that class finds at least one declaration, `ranges::begin(E)` is ill-formed.</ins ></p ></li >
66- <li ><p >(2.5) — [… ]</p ></li >
71+ <li ><p >(2.5) — Otherwise, if `T` is a class or enumeration type and `auto(begin(t))`
72+ is a valid expression whose type models `input_or_output_iterator` where the meaning of `begin`
73+ is established as-if by performing argument-dependent lookup only (<sref ref =" [basic.lookup.argdep]" />),
74+ then `ranges::begin(E)` is expression-equivalent to that expression.</p ></li >
6775<li ><p >(2.6) — Otherwise, `ranges::begin(E)` is ill-formed.</p ></li >
6876</ol >
6977</blockquote >
@@ -76,14 +84,24 @@ requires compilers to add new intrinsics when reflection is absent.
7684-2- Given a subexpression `E` with type `T`, let `t` be an lvalue that denotes the reified object for `E`. Then:
7785</p >
7886<ol style =" list-style-type: none" >
79- <li ><p >(2.1) — [… ]</p ></li >
80- <li ><p >(2.2) — [… ]</p ></li >
81- <li ><p >(2.3) — [… ]</p ></li >
82- <li ><p >(2.4) — [… ]</p ></li >
83- <li ><p >(2.5) — [… ]</p ></li >
87+ <li ><p >(2.1) — If `E` is an rvalue and <tt >enable_borrowed_range< remove_cv_t< T>> </tt >
88+ is `false`, `ranges::end(E)` is ill-formed.</p ></li >
89+ <li ><p >(2.2) — Otherwise, if `T` is an array type (<sref ref =" [dcl.array]" />) and
90+ <tt >remove_all_extents_t< T> </tt > is an incomplete type, `ranges::end(E)` is ill-formed
91+ with no diagnostic required.</p ></li >
92+ <li ><p >(2.3) — Otherwise, if `T` is an array of unknown bound, `ranges::end(E)` is ill-formed.</p ></li >
93+ <li ><p >(2.4) — Otherwise, if `T` is an array, `ranges::end(E)` is expression-equivalent to
94+ <tt >t + extent_v< T> </tt >.</p ></li >
95+ <li ><p >(2.5) — Otherwise, if `auto(t.end())` is a valid expression whose type models
96+ <tt >sentinel_for< iterator_t< T>> </tt > then `ranges::end(E)` is expression-equivalent to
97+ `auto(t.end())`.</p ></li >
8498<li ><p ><ins >(2.?) — Otherwise, if <tt >remove_cvref_t< T> </tt > is a class type and search for
8599`end` in the scope of that class finds at least one declaration, `ranges::end(E)` is ill-formed.</ins ></p ></li >
86- <li ><p >(2.6) — [… ]</p ></li >
100+ <li ><p >(2.6) — Otherwise, if `T` is a class or enumeration type and `auto(end(t))`
101+ is a valid expression whose type models <tt >sentinel_for< iterator_t< T>> </tt >
102+ where the meaning of end is established as-if by performing argument-dependent
103+ lookup only (<sref ref =" [basic.lookup.argdep]" />), then `ranges::end(E)` is expression-equivalent
104+ to that expression.</p ></li >
87105<li ><p >(2.7) — Otherwise, `ranges::end(E)` is ill-formed.</p ></li >
88106</ol >
89107</blockquote >
0 commit comments