tmp/tmp3rugi256/{from.md → to.md}
RENAMED
|
@@ -58,15 +58,15 @@ semantically well-defined feature. Semantic transformation. If volatile
|
|
| 58 |
semantics are required for the copy, a user-declared constructor or
|
| 59 |
assignment must be provided. If non-volatile semantics are required, an
|
| 60 |
explicit `const_cast` can be used. Seldom.
|
| 61 |
|
| 62 |
**Change:** Bit-fields of type plain `int` are signed. **Rationale:**
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
|
| 69 |
**Change:** In C++, the name of a nested class is local to its enclosing
|
| 70 |
class. In C the name of the nested class belongs to the same scope as
|
| 71 |
the name of the outermost enclosing class.
|
| 72 |
|
|
@@ -86,27 +86,27 @@ maintaining locality within a class. A coherent set of scope rules for
|
|
| 86 |
C++ based on the C rule would be very complicated and C++ programmers
|
| 87 |
would be unable to predict reliably the meanings of nontrivial examples
|
| 88 |
involving nested or local functions. **Effect on original feature:**
|
| 89 |
Change to semantics of well-defined feature. Semantic transformation. To
|
| 90 |
make the struct type name visible in the scope of the enclosing struct,
|
| 91 |
-
the struct tag
|
| 92 |
before the enclosing struct is defined. Example:
|
| 93 |
|
| 94 |
``` cpp
|
| 95 |
struct Y; // struct Y and struct X are at the same scope
|
| 96 |
struct X {
|
| 97 |
struct Y { ... } y;
|
| 98 |
};
|
| 99 |
```
|
| 100 |
|
| 101 |
All the definitions of C struct types enclosed in other struct
|
| 102 |
-
definitions and accessed outside the scope of the enclosing struct
|
| 103 |
be exported to the scope of the enclosing struct. Note: this is a
|
| 104 |
consequence of the difference in scope rules, which is documented in
|
| 105 |
[[basic.scope]]. Seldom.
|
| 106 |
|
| 107 |
-
**Change:** In C++, a typedef
|
| 108 |
definition after being used in that definition.
|
| 109 |
|
| 110 |
Example:
|
| 111 |
|
| 112 |
``` cpp
|
|
|
|
| 58 |
semantics are required for the copy, a user-declared constructor or
|
| 59 |
assignment must be provided. If non-volatile semantics are required, an
|
| 60 |
explicit `const_cast` can be used. Seldom.
|
| 61 |
|
| 62 |
**Change:** Bit-fields of type plain `int` are signed. **Rationale:**
|
| 63 |
+
The signedness needs to be consistent among template specializations.
|
| 64 |
+
For consistency, the implementation freedom was eliminated for
|
| 65 |
+
non-dependent types, too. **Effect on original feature:** The choice is
|
| 66 |
+
implementation-defined in C, but not so in C++. Syntactic
|
| 67 |
+
transformation. Seldom.
|
| 68 |
|
| 69 |
**Change:** In C++, the name of a nested class is local to its enclosing
|
| 70 |
class. In C the name of the nested class belongs to the same scope as
|
| 71 |
the name of the outermost enclosing class.
|
| 72 |
|
|
|
|
| 86 |
C++ based on the C rule would be very complicated and C++ programmers
|
| 87 |
would be unable to predict reliably the meanings of nontrivial examples
|
| 88 |
involving nested or local functions. **Effect on original feature:**
|
| 89 |
Change to semantics of well-defined feature. Semantic transformation. To
|
| 90 |
make the struct type name visible in the scope of the enclosing struct,
|
| 91 |
+
the struct tag can be declared in the scope of the enclosing struct,
|
| 92 |
before the enclosing struct is defined. Example:
|
| 93 |
|
| 94 |
``` cpp
|
| 95 |
struct Y; // struct Y and struct X are at the same scope
|
| 96 |
struct X {
|
| 97 |
struct Y { ... } y;
|
| 98 |
};
|
| 99 |
```
|
| 100 |
|
| 101 |
All the definitions of C struct types enclosed in other struct
|
| 102 |
+
definitions and accessed outside the scope of the enclosing struct can
|
| 103 |
be exported to the scope of the enclosing struct. Note: this is a
|
| 104 |
consequence of the difference in scope rules, which is documented in
|
| 105 |
[[basic.scope]]. Seldom.
|
| 106 |
|
| 107 |
+
**Change:** In C++, a *typedef-name* may not be redeclared in a class
|
| 108 |
definition after being used in that definition.
|
| 109 |
|
| 110 |
Example:
|
| 111 |
|
| 112 |
``` cpp
|