tmp/tmp_henacwp/{from.md → to.md}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
-
## Nested classes <a id="class.access.nest">[[class.access.nest]]</a>
|
| 2 |
|
| 3 |
A nested class is a member and as such has the same access rights as any
|
| 4 |
other member. The members of an enclosing class have no special access
|
| 5 |
-
to members of a nested class; the usual access rules
|
| 6 |
-
|
| 7 |
|
| 8 |
[*Example 1*:
|
| 9 |
|
| 10 |
``` cpp
|
| 11 |
class E {
|
|
@@ -26,138 +26,5 @@ class E {
|
|
| 26 |
};
|
| 27 |
```
|
| 28 |
|
| 29 |
— *end example*]
|
| 30 |
|
| 31 |
-
<!-- Link reference definitions -->
|
| 32 |
-
[basic.compound]: basic.md#basic.compound
|
| 33 |
-
[basic.def.odr]: basic.md#basic.def.odr
|
| 34 |
-
[basic.fundamental]: basic.md#basic.fundamental
|
| 35 |
-
[basic.life]: basic.md#basic.life
|
| 36 |
-
[basic.link]: basic.md#basic.link
|
| 37 |
-
[basic.lookup]: basic.md#basic.lookup
|
| 38 |
-
[basic.lookup.elab]: basic.md#basic.lookup.elab
|
| 39 |
-
[basic.lookup.qual]: basic.md#basic.lookup.qual
|
| 40 |
-
[basic.lookup.unqual]: basic.md#basic.lookup.unqual
|
| 41 |
-
[basic.scope]: basic.md#basic.scope
|
| 42 |
-
[basic.scope.class]: basic.md#basic.scope.class
|
| 43 |
-
[basic.scope.hiding]: basic.md#basic.scope.hiding
|
| 44 |
-
[basic.start.dynamic]: basic.md#basic.start.dynamic
|
| 45 |
-
[basic.start.static]: basic.md#basic.start.static
|
| 46 |
-
[basic.start.term]: basic.md#basic.start.term
|
| 47 |
-
[basic.stc]: basic.md#basic.stc
|
| 48 |
-
[basic.types]: basic.md#basic.types
|
| 49 |
-
[c.strings]: strings.md#c.strings
|
| 50 |
-
[class]: #class
|
| 51 |
-
[class.abstract]: #class.abstract
|
| 52 |
-
[class.access]: #class.access
|
| 53 |
-
[class.access.base]: #class.access.base
|
| 54 |
-
[class.access.nest]: #class.access.nest
|
| 55 |
-
[class.access.spec]: #class.access.spec
|
| 56 |
-
[class.access.virt]: #class.access.virt
|
| 57 |
-
[class.base.init]: special.md#class.base.init
|
| 58 |
-
[class.bit]: #class.bit
|
| 59 |
-
[class.cdtor]: special.md#class.cdtor
|
| 60 |
-
[class.copy]: special.md#class.copy
|
| 61 |
-
[class.ctor]: special.md#class.ctor
|
| 62 |
-
[class.derived]: #class.derived
|
| 63 |
-
[class.dtor]: special.md#class.dtor
|
| 64 |
-
[class.free]: special.md#class.free
|
| 65 |
-
[class.friend]: #class.friend
|
| 66 |
-
[class.local]: #class.local
|
| 67 |
-
[class.mem]: #class.mem
|
| 68 |
-
[class.member.lookup]: #class.member.lookup
|
| 69 |
-
[class.mfct]: #class.mfct
|
| 70 |
-
[class.mfct.non-static]: #class.mfct.non-static
|
| 71 |
-
[class.mi]: #class.mi
|
| 72 |
-
[class.name]: #class.name
|
| 73 |
-
[class.nest]: #class.nest
|
| 74 |
-
[class.nested.type]: #class.nested.type
|
| 75 |
-
[class.paths]: #class.paths
|
| 76 |
-
[class.protected]: #class.protected
|
| 77 |
-
[class.static]: #class.static
|
| 78 |
-
[class.static.data]: #class.static.data
|
| 79 |
-
[class.static.mfct]: #class.static.mfct
|
| 80 |
-
[class.this]: #class.this
|
| 81 |
-
[class.union]: #class.union
|
| 82 |
-
[class.union.anon]: #class.union.anon
|
| 83 |
-
[class.virtual]: #class.virtual
|
| 84 |
-
[conv.mem]: conv.md#conv.mem
|
| 85 |
-
[conv.ptr]: conv.md#conv.ptr
|
| 86 |
-
[dcl.enum]: dcl.md#dcl.enum
|
| 87 |
-
[dcl.fct]: dcl.md#dcl.fct
|
| 88 |
-
[dcl.fct.def]: dcl.md#dcl.fct.def
|
| 89 |
-
[dcl.fct.def.delete]: dcl.md#dcl.fct.def.delete
|
| 90 |
-
[dcl.fct.default]: dcl.md#dcl.fct.default
|
| 91 |
-
[dcl.fct.spec]: dcl.md#dcl.fct.spec
|
| 92 |
-
[dcl.init.aggr]: dcl.md#dcl.init.aggr
|
| 93 |
-
[dcl.init.ref]: dcl.md#dcl.init.ref
|
| 94 |
-
[dcl.inline]: dcl.md#dcl.inline
|
| 95 |
-
[dcl.stc]: dcl.md#dcl.stc
|
| 96 |
-
[dcl.type.cv]: dcl.md#dcl.type.cv
|
| 97 |
-
[dcl.type.elab]: dcl.md#dcl.type.elab
|
| 98 |
-
[dcl.typedef]: dcl.md#dcl.typedef
|
| 99 |
-
[depr.static_constexpr]: future.md#depr.static_constexpr
|
| 100 |
-
[expr.ass]: expr.md#expr.ass
|
| 101 |
-
[expr.call]: expr.md#expr.call
|
| 102 |
-
[expr.cast]: expr.md#expr.cast
|
| 103 |
-
[expr.const]: expr.md#expr.const
|
| 104 |
-
[expr.eq]: expr.md#expr.eq
|
| 105 |
-
[expr.prim]: expr.md#expr.prim
|
| 106 |
-
[expr.prim.this]: expr.md#expr.prim.this
|
| 107 |
-
[expr.ref]: expr.md#expr.ref
|
| 108 |
-
[expr.static.cast]: expr.md#expr.static.cast
|
| 109 |
-
[expr.unary.op]: expr.md#expr.unary.op
|
| 110 |
-
[fig:nonvirt]: #fig:nonvirt
|
| 111 |
-
[fig:virt]: #fig:virt
|
| 112 |
-
[fig:virtnonvirt]: #fig:virtnonvirt
|
| 113 |
-
[intro.object]: intro.md#intro.object
|
| 114 |
-
[namespace.def]: dcl.md#namespace.def
|
| 115 |
-
[namespace.udecl]: dcl.md#namespace.udecl
|
| 116 |
-
[over]: over.md#over
|
| 117 |
-
[over.ass]: over.md#over.ass
|
| 118 |
-
[over.load]: over.md#over.load
|
| 119 |
-
[over.match]: over.md#over.match
|
| 120 |
-
[over.match.call]: over.md#over.match.call
|
| 121 |
-
[over.match.funcs]: over.md#over.match.funcs
|
| 122 |
-
[over.oper]: over.md#over.oper
|
| 123 |
-
[string.classes]: strings.md#string.classes
|
| 124 |
-
[temp]: temp.md#temp
|
| 125 |
-
[temp.arg]: temp.md#temp.arg
|
| 126 |
-
[temp.dep.type]: temp.md#temp.dep.type
|
| 127 |
-
[temp.friend]: temp.md#temp.friend
|
| 128 |
-
[temp.inst]: temp.md#temp.inst
|
| 129 |
-
[temp.mem]: temp.md#temp.mem
|
| 130 |
-
[temp.param]: temp.md#temp.param
|
| 131 |
-
[temp.spec]: temp.md#temp.spec
|
| 132 |
-
[temp.variadic]: temp.md#temp.variadic
|
| 133 |
-
|
| 134 |
-
[^1]: Base class subobjects are not so constrained.
|
| 135 |
-
|
| 136 |
-
[^2]: This ensures that two subobjects that have the same class type and
|
| 137 |
-
that belong to the same most derived object are not allocated at the
|
| 138 |
-
same address ([[expr.eq]]).
|
| 139 |
-
|
| 140 |
-
[^3]: The acronym POD stands for “plain old data”.
|
| 141 |
-
|
| 142 |
-
[^4]: See, for example, `<cstring>` ([[c.strings]]).
|
| 143 |
-
|
| 144 |
-
[^5]: A function with the same name but a different parameter list
|
| 145 |
-
(Clause [[over]]) as a virtual function is not necessarily virtual
|
| 146 |
-
and does not override. The use of the `virtual` specifier in the
|
| 147 |
-
declaration of an overriding function is legal but redundant (has
|
| 148 |
-
empty semantics). Access control (Clause [[class.access]]) is not
|
| 149 |
-
considered in determining overriding.
|
| 150 |
-
|
| 151 |
-
[^6]: Multi-level pointers to classes or references to multi-level
|
| 152 |
-
pointers to classes are not allowed.
|
| 153 |
-
|
| 154 |
-
[^7]: Access permissions are thus transitive and cumulative to nested
|
| 155 |
-
and local classes.
|
| 156 |
-
|
| 157 |
-
[^8]: As specified previously in Clause [[class.access]], private
|
| 158 |
-
members of a base class remain inaccessible even to derived classes
|
| 159 |
-
unless `friend` declarations within the base class definition are
|
| 160 |
-
used to grant access explicitly.
|
| 161 |
-
|
| 162 |
-
[^9]: This additional check does not apply to other members, e.g.,
|
| 163 |
-
static data members or enumerator member constants.
|
|
|
|
| 1 |
+
### Nested classes <a id="class.access.nest">[[class.access.nest]]</a>
|
| 2 |
|
| 3 |
A nested class is a member and as such has the same access rights as any
|
| 4 |
other member. The members of an enclosing class have no special access
|
| 5 |
+
to members of a nested class; the usual access rules [[class.access]]
|
| 6 |
+
shall be obeyed.
|
| 7 |
|
| 8 |
[*Example 1*:
|
| 9 |
|
| 10 |
``` cpp
|
| 11 |
class E {
|
|
|
|
| 26 |
};
|
| 27 |
```
|
| 28 |
|
| 29 |
— *end example*]
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|