From Jason Turner

[stmt.ranged]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp4sgphltx/{from.md → to.md} +6 -10
tmp/tmp4sgphltx/{from.md → to.md} RENAMED
@@ -27,20 +27,20 @@ where
27
  if it were surrounded by parentheses (so that a comma operator cannot
28
  be reinterpreted as delimiting two *init-declarator*s);
29
  - *`range`*, *`begin`*, and *`end`* are variables defined for exposition
30
  only; and
31
  - *`begin-expr`* and *`end-expr`* are determined as follows:
32
- - if the *for-range-initializer* is an expression of array type `R`,
33
  *`begin-expr`* and *`end-expr`* are *`range`* and *`range`* `+` `N`,
34
  respectively, where `N` is the array bound. If `R` is an array of
35
  unknown bound or an array of incomplete type, the program is
36
  ill-formed;
37
- - if the *for-range-initializer* is an expression of class type `C`,
38
- and searches in the scope of `C` [[class.member.lookup]] for the
39
- names `begin` and `end` each find at least one declaration,
40
- *`begin-expr`* and *`end-expr`* are `range.begin()` and
41
- `range.end()`, respectively;
42
  - otherwise, *`begin-expr`* and *`end-expr`* are `begin(range)` and
43
  `end(range)`, respectively, where `begin` and `end` undergo
44
  argument-dependent lookup [[basic.lookup.argdep]].
45
  \[*Note 1*: Ordinary unqualified lookup [[basic.lookup.unqual]] is
46
  not performed. — *end note*]
@@ -73,9 +73,5 @@ void foo() {
73
  }
74
  ```
75
 
76
  — *end example*]
77
 
78
- In the *decl-specifier-seq* of a *for-range-declaration*, each
79
- *decl-specifier* shall be either a *type-specifier* or `constexpr`. The
80
- *decl-specifier-seq* shall not define a class or enumeration.
81
-
 
27
  if it were surrounded by parentheses (so that a comma operator cannot
28
  be reinterpreted as delimiting two *init-declarator*s);
29
  - *`range`*, *`begin`*, and *`end`* are variables defined for exposition
30
  only; and
31
  - *`begin-expr`* and *`end-expr`* are determined as follows:
32
+ - if the type of *`range`* is a reference to an array type `R`,
33
  *`begin-expr`* and *`end-expr`* are *`range`* and *`range`* `+` `N`,
34
  respectively, where `N` is the array bound. If `R` is an array of
35
  unknown bound or an array of incomplete type, the program is
36
  ill-formed;
37
+ - if the type of *`range`* is a reference to a class type `C`, and
38
+ searches in the scope of `C` [[class.member.lookup]] for the names
39
+ `begin` and `end` each find at least one declaration, *`begin-expr`*
40
+ and *`end-expr`* are `range.begin()` and `range.end()`,
41
+ respectively;
42
  - otherwise, *`begin-expr`* and *`end-expr`* are `begin(range)` and
43
  `end(range)`, respectively, where `begin` and `end` undergo
44
  argument-dependent lookup [[basic.lookup.argdep]].
45
  \[*Note 1*: Ordinary unqualified lookup [[basic.lookup.unqual]] is
46
  not performed. — *end note*]
 
73
  }
74
  ```
75
 
76
  — *end example*]
77