From Jason Turner

[expr.prim.this]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp8g3kre2_/{from.md → to.md} +11 -4
tmp/tmp8g3kre2_/{from.md → to.md} RENAMED
@@ -8,19 +8,26 @@ The *current class* at a program point is the class associated with the
8
  innermost class scope containing that point.
9
 
10
  [*Note 1*: A *lambda-expression* does not introduce a class
11
  scope. — *end note*]
12
 
 
 
 
 
 
 
 
13
  If a declaration declares a member function or member function template
14
  of a class `X`, the expression `this` is a prvalue of type “pointer to
15
  *cv-qualifier-seq* `X`” wherever `X` is the current class between the
16
  optional *cv-qualifier-seq* and the end of the *function-definition*,
17
  *member-declarator*, or *declarator*. It shall not appear within the
18
- declaration of either a static member function or an explicit object
19
- member function of the current class (although its type and value
20
- category are defined within such member functions as they are within an
21
- implicit object member function).
22
 
23
  [*Note 2*: This is because declaration matching does not occur until
24
  the complete declarator is known. — *end note*]
25
 
26
  [*Note 3*:
 
8
  innermost class scope containing that point.
9
 
10
  [*Note 1*: A *lambda-expression* does not introduce a class
11
  scope. — *end note*]
12
 
13
+ If the expression `this` appears within the predicate of a contract
14
+ assertion [[basic.contract.general]] (including as the result of an
15
+ implicit transformation [[expr.prim.id.general]] and including in the
16
+ bodies of nested *lambda-expression*s) and the current class encloses
17
+ the contract assertion, `const` is combined with the *cv-qualifier-seq*
18
+ used to generate the resulting type (see below).
19
+
20
  If a declaration declares a member function or member function template
21
  of a class `X`, the expression `this` is a prvalue of type “pointer to
22
  *cv-qualifier-seq* `X`” wherever `X` is the current class between the
23
  optional *cv-qualifier-seq* and the end of the *function-definition*,
24
  *member-declarator*, or *declarator*. It shall not appear within the
25
+ declaration of a static or explicit object member function of the
26
+ current class (although its type and value category are defined within
27
+ such member functions as they are within an implicit object member
28
+ function).
29
 
30
  [*Note 2*: This is because declaration matching does not occur until
31
  the complete declarator is known. — *end note*]
32
 
33
  [*Note 3*: