tmp/tmpabdo8g0l/{from.md → to.md}
RENAMED
|
@@ -5,16 +5,13 @@ keyword `this` is a prvalue expression whose value is the address of the
|
|
| 5 |
object for which the function is called. The type of `this` in a member
|
| 6 |
function of a class `X` is `X*`. If the member function is declared
|
| 7 |
`const`, the type of `this` is `const` `X*`, if the member function is
|
| 8 |
declared `volatile`, the type of `this` is `volatile` `X*`, and if the
|
| 9 |
member function is declared `const` `volatile`, the type of `this` is
|
| 10 |
-
`const` `volatile` `X*`.
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
called is accessed through a `const` access path; therefore, a `const`
|
| 14 |
-
member function shall not modify the object and its non-static data
|
| 15 |
-
members.
|
| 16 |
|
| 17 |
``` cpp
|
| 18 |
struct s {
|
| 19 |
int a;
|
| 20 |
int f() const;
|
|
|
|
| 5 |
object for which the function is called. The type of `this` in a member
|
| 6 |
function of a class `X` is `X*`. If the member function is declared
|
| 7 |
`const`, the type of `this` is `const` `X*`, if the member function is
|
| 8 |
declared `volatile`, the type of `this` is `volatile` `X*`, and if the
|
| 9 |
member function is declared `const` `volatile`, the type of `this` is
|
| 10 |
+
`const` `volatile` `X*`. thus in a `const` member function, the object
|
| 11 |
+
for which the function is called is accessed through a `const` access
|
| 12 |
+
path.
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
``` cpp
|
| 15 |
struct s {
|
| 16 |
int a;
|
| 17 |
int f() const;
|