|
1 | 1 | import cpp |
2 | 2 |
|
3 | 3 | /** |
4 | | - * A C++ name qualifier, for example `N::`. |
| 4 | + * A C++ name qualifier, for example `N::` in the following code: |
| 5 | + * ``` |
| 6 | + * namespace N { |
| 7 | + * int f() { |
| 8 | + * ... |
| 9 | + * } |
| 10 | + * } |
| 11 | + * |
| 12 | + * int g() { |
| 13 | + * return N::f(); |
| 14 | + * } |
| 15 | + * ``` |
5 | 16 | */ |
6 | 17 | class NameQualifier extends NameQualifiableElement, @namequalifier { |
7 | 18 | /** |
@@ -61,10 +72,21 @@ class NameQualifier extends NameQualifiableElement, @namequalifier { |
61 | 72 |
|
62 | 73 | /** |
63 | 74 | * A C++ element that can be qualified with a name. This is in practice |
64 | | - * either an expression or a name qualifier. For instance, in |
65 | | - * `N1::N2::f()`, there are two name-qualifiable elements: the expression |
66 | | - * `f()` and the name qualifier `N2::`. The former is qualified by `N2` and |
67 | | - * the latter is qualified by `N1`. |
| 75 | + * either an expression or a name qualifier. For example, there are two |
| 76 | + * name-qualifiable elements in the following code, the expression `f()` |
| 77 | + * (which is qualified by `N::`), and the qualifier `N::` (which is not |
| 78 | + * itself qualified in this example): |
| 79 | + * ``` |
| 80 | + * namespace N { |
| 81 | + * int f() { |
| 82 | + * ... |
| 83 | + * } |
| 84 | + * } |
| 85 | + * |
| 86 | + * int g() { |
| 87 | + * return N::f(); |
| 88 | + * } |
| 89 | + * ``` |
68 | 90 | */ |
69 | 91 | class NameQualifiableElement extends Element, @namequalifiableelement { |
70 | 92 | /** |
@@ -99,8 +121,19 @@ class NameQualifiableElement extends Element, @namequalifiableelement { |
99 | 121 | } |
100 | 122 |
|
101 | 123 | /** |
102 | | - * A C++ element that can qualify a name. For example, `N` in `N::f()`. A |
103 | | - * name-qualifying element is either a namespace or a user-defined type. |
| 124 | + * A C++ element that can qualify a name. For example, the namespaces `A` and |
| 125 | + * `A::B` and the class `A::C` in the following code: |
| 126 | + * ``` |
| 127 | + * namespace A { |
| 128 | + * namespace B { |
| 129 | + * ... |
| 130 | + * } |
| 131 | + * |
| 132 | + * class C { |
| 133 | + * ... |
| 134 | + * }; |
| 135 | + * } |
| 136 | + * ``` |
104 | 137 | */ |
105 | 138 | class NameQualifyingElement extends Element, @namequalifyingelement { |
106 | 139 | /** |
|
0 commit comments