tmp/tmphu3l8lvj/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Preamble <a id="basic.pre">[[basic.pre]]</a>
|
| 2 |
+
|
| 3 |
+
[*Note 1*: This Clause presents the basic concepts of the C++ language.
|
| 4 |
+
It explains the difference between an object and a name and how they
|
| 5 |
+
relate to the value categories for expressions. It introduces the
|
| 6 |
+
concepts of a declaration and a definition and presents C++’s notion of
|
| 7 |
+
type, scope, linkage, and storage duration. The mechanisms for starting
|
| 8 |
+
and terminating a program are discussed. Finally, this Clause presents
|
| 9 |
+
the fundamental types of the language and lists the ways of constructing
|
| 10 |
+
compound types from these. — *end note*]
|
| 11 |
+
|
| 12 |
+
[*Note 2*: This Clause does not cover concepts that affect only a
|
| 13 |
+
single part of the language. Such concepts are discussed in the relevant
|
| 14 |
+
Clauses. — *end note*]
|
| 15 |
+
|
| 16 |
+
An *entity* is a value, object, reference, structured binding, function,
|
| 17 |
+
enumerator, type, class member, bit-field, template, template
|
| 18 |
+
specialization, namespace, or pack.
|
| 19 |
+
|
| 20 |
+
A *name* is a use of an *identifier* [[lex.name]],
|
| 21 |
+
*operator-function-id* [[over.oper]], *literal-operator-id*
|
| 22 |
+
[[over.literal]], *conversion-function-id* [[class.conv.fct]], or
|
| 23 |
+
*template-id* [[temp.names]] that denotes an entity or label (
|
| 24 |
+
[[stmt.goto]], [[stmt.label]]).
|
| 25 |
+
|
| 26 |
+
Every name that denotes an entity is introduced by a *declaration*.
|
| 27 |
+
Every name that denotes a label is introduced either by a `goto`
|
| 28 |
+
statement [[stmt.goto]] or a *labeled-statement* [[stmt.label]].
|
| 29 |
+
|
| 30 |
+
A *variable* is introduced by the declaration of a reference other than
|
| 31 |
+
a non-static data member or of an object. The variable’s name, if any,
|
| 32 |
+
denotes the reference or object.
|
| 33 |
+
|
| 34 |
+
A *local entity* is a variable with automatic storage duration
|
| 35 |
+
[[basic.stc.auto]], a structured binding [[dcl.struct.bind]] whose
|
| 36 |
+
corresponding variable is such an entity, or the `*this` object
|
| 37 |
+
[[expr.prim.this]].
|
| 38 |
+
|
| 39 |
+
Some names denote types or templates. In general, whenever a name is
|
| 40 |
+
encountered it is necessary to determine whether that name denotes one
|
| 41 |
+
of these entities before continuing to parse the program that contains
|
| 42 |
+
it. The process that determines this is called *name lookup*
|
| 43 |
+
[[basic.lookup]].
|
| 44 |
+
|
| 45 |
+
Two names are *the same* if
|
| 46 |
+
|
| 47 |
+
- they are *identifier*s composed of the same character sequence, or
|
| 48 |
+
- they are *operator-function-id*s formed with the same operator, or
|
| 49 |
+
- they are *conversion-function-id*s formed with the same type, or
|
| 50 |
+
- they are *template-id*s that refer to the same class, function, or
|
| 51 |
+
variable [[temp.type]], or
|
| 52 |
+
- they are *literal-operator-id*s [[over.literal]] formed with the same
|
| 53 |
+
literal suffix identifier.
|
| 54 |
+
|
| 55 |
+
A name used in more than one translation unit can potentially refer to
|
| 56 |
+
the same entity in these translation units depending on the linkage
|
| 57 |
+
[[basic.link]] of the name specified in each translation unit.
|
| 58 |
+
|