Title: Theory / Unimportant / CS / Programming / C++ / Manual / Norm / 06 Declarations;
Tags: declaration todo_declaration seen_description computer_to_instruction hasSeenConjDef

Name: A declaration
Definition: its type and
Page: 152,
40
Chapter: 6, 2
Section: 3, 2.2
Context: C++ standard
Definition2: potentially a value
Conjdef: with
Intuition: a statement that introduces a name into the program
DefType: Any introduction of a variable,

Name: A definition
Definition: A declaration in which a value is given
Page: 152
Chapter: 6
Section: 3
Context: C++ standard

Question: If a variable is declared multiple time
Answer: each declaration must have the same type
Page: 152
Chapter: 6
Section: 3
Context: C++ standard

Name: optional suffix function specifier
Definition: const
Page: 153
Chapter: 6
Section: 3.1
Context: C++ standard
Definition2: noexcept
Conjdef: All of

Name: structure of a declaration
Definition: Optional prefix specifiers
Page: 153
Chapter: 6
Section: 3.1
Context: C++ standard
Definition2: A base type
Conjdef: In this order
Definition3: A declarator optionally including a name
Definition4: Optional suffix function specifiers
Definition5: An optional initializer or function body

Question: When declaring multiple name, operator (such as *, []) apply to
Answer: individual names
Page: 155
Chapter: 6
Section: 3.2
Context: C++ standard

Instruction: auto var = expr;
Page: 42
Meaning: Declare a variable var whose type and values are the one of expr
Language: C++
Chapter: 2
Section: 2.2

Name: Name
Definition: A sequence of letter and digit, starting with a letter or _, which is not a keyword
Page: 155
Chapter: 6
Section: 3.3
Name2: Identifier

Name: Reserved names
Definition: starting by __
Page: 155
Chapter: 6
Section: 3.3
Context: C++
Definition2: starting by _ and a capital letter
Conjdef: Name starting by

Name: Local name
Definition: A name defined in a function or lambda
Page: 157
Chapter: 6
Section: 3.4
Context: C++

Question: Names reserved for special facilities in the implementation
Answer: Name in global namespace starting with _
Page: 155
Chapter: 6
Section: 3.3

Question: Are name case sensitive in C++ ?
Answer: Yes
Page: 155
Chapter: 6
Section: 3.3

Question: How to choose a name length
Answer: Name length should ideally be proportional to the lifespan. Long name for large scope, small i, x for local scope
Page: 156
Chapter: 6
Section: 3.3

Question: When to prefer assignment with = instead of list initialization
Answer: When using auto
Page: 157
Chapter: 6
Section: 3.3

Name: A local scope
Definition: The scope delimited by a block
Page: 157
Chapter: 6
Section: 3.4
Context: C++

Name: A (class) member name
Definition: A name defined in a class outside of a function, class, enum class or other namespace.
Page: 157
Chapter: 6
Section: 3.4
Context: C++

Name: A class scope
Definition: A scope starting from the opening { to the end of the class declaration
Page: 157
Chapter: 6
Section: 3.4
Context: C++

Name: A namespace scope
Definition: A scope starting from the point of declaration to the end of the namespace
Page: 157
Chapter: 6
Section: 3.4
Context: C++

Name: A namespace member name
Definition: A name defined in a namespace outside any function, lambda, class, enum class or other namespace
Page: 157
Chapter: 6
Section: 3.4
Context: C++

Name: A global name
Definition: A name defined outside of any function, class, enum class or namespace
Page: 157
Chapter: 6
Section: 3.4
Context: C++

Name: A global scope
Definition: A scope from the point of declaration to the end of the file in which the declaration occurs
Page: 157
Chapter: 6
Section: 3.4
Context: C++

Name: A statement scope
Definition: A scope starting in the () of a for, while, if, or switch, and ending with it.
Page: 157
Chapter: 6
Section: 3.4
Context: C++

Name: A function scope
Definition: A scope starting with a label declaration and ending with the end of the function
Page: 157
Chapter: 6
Section: 3.4
Context: C++

Instruction: ::x
Page: 158
Effect: Access the global variable x
Language: C++
Chapter: 6
Section: 3.4
Intuition: Useful if the global variable is hidden by a local one

Instruction: t var {expr};
Page: 158
Language: C++
Chapter: 6
Section: 3.5
Identifier: var
Name: List initialization
Variables: t a type
expr an expression
Assuming: Type t can actually contains the expression expr
Typ: T
Initialization: Expr

Instruction: t var {};
Page: 158
Meaning: Define a variable var of type t with the default value
Language: C++
Chapter: 6
Section: 3.5
Variables: t a type
expr an expression

Question: Why to prefer list assignment
Answer: Ensuring that the type can actually contain the result expression without loosing informations
Page: 157
Chapter: 6
Section: 3.3
Context: C++
Answer2: Parenthesis may be interpreted as a call to a constructor

Question: When is it preferrable not to initialize a variable at declaration
Answer: If initialization is costly, such as initializing a buffer by filling it with 0
Page: 161
Chapter: 6
Section: 3.5.1

Name: static object
Definition: Global
Page: 161
Chapter: 6
Section: 3.5.1
Context: C++
Definition2: Local static
Conjdef: Either
Definition3: Static member
Definition4: Namespace

Question: What occurs when a variable is not initialized ?
Answer: It is implicitly initialized with {} in static object
Page: 161
Chapter: 6
Section: 3.5.1
Answer2: User-defined type with a default constructor uses it
Answer3: Otherwise non initialized

Name: local object
Definition: An object initialized in a function
Page: 161
Chapter: 6
Section: 3.5.1
Name2: dynamic object
Name3: Heap object

Instruction: t var {expr_1, ..., expr_n-1};
Page: 162
Meaning: Initialize var with constructor applied to (expr_1, ..., expr_n-1) or initializer_list ({expr1, ..., exprn-1})
Language: C++
Chapter: 6
Section: 3.5.2
Variables: t a type

Typ: decltype(expr)
Meaning: The type of expr
Page: 165
Language: C++
Chapter: 6
Section: 3.6

Name: An object
Definition: A contiguous region of storage
Page: 165
Chapter: 6
Section: 4
Definition2: A struct
Example: A string/an array

Name: An lvalue
Definition: A value refering to an object with identity which is not movable
Page: 165
Chapter: 6
Section: 4
Context: C++
Example: A variable
Etymology: Can be put on the left side of an assignment

Name: A modifiable lvalue
Definition: An lvalue which is not declared with const
Page: 165
Chapter: 6
Section: 4
Context: C++

Name: An object which has identity
Definition: An object such that The program has the name of, pointer to, or reference to the object so that it is
possible to determine if two objects are the same, whether the value of the object has
changed, etc.
Page: 166
Chapter: 6
Section: 4.1
Context: C++
Name2: A generazied lvalue
Abbreviation2: glvalue

Name: A movable object
Definition: An object allowing to move its value to another
location and leave the object in a valid but unspecified state, rather than copying
Page: 166
Chapter: 6
Section: 4.1
Context: C++
Name2: An rvalue
Etymology: A value which is not a lvalue

Name: A pure rvalue
Definition: without identity
Page: 166
Chapter: 6
Section: 4.1
Context: C++
Definition2: which can be moved
Conjdef: both
Abbreviation: prvalue
DefType: A value

Name: A xvalue
Definition: An object movable with identity
Page: 166
Chapter: 6
Section: 4.1
Context: C++
Etymology: Expert value maybe

Name: The lifetime of o
Definition: The time between when o's constructor ends and when o's destructor starts
Page: 166
Chapter: 6
Section: 4.2
Variables: o an object
Context: C++

Name: An automatic object
Definition: An object created when its definition is encountered and destroyed when its name goes out of scope
Page: 167
Chapter: 6
Section: 4.2
Context: C++

Name: A static object
Definition: An object declared in global or namespace scope, or with "static" in a function.
Page: 167
Chapter: 6
Section: 4.2
Context: C++
Intuition: An object created only once and deleted when the program terminate

Name: A free store object
Definition: An object created with new, deleted with delete, such that the program controls its lifetime
Page: 167
Chapter: 6
Section: 4.2
Context: C++

Name: A thread-local object
Definition: An object declared with thread_local, whose life ends with its thread
Page: 167
Chapter: 6
Section: 4.2
Context: C++

Name: A temporary object
Definition: An object whose lifetime is determined by its use
Page: 167
Chapter: 6
Section: 4.2
Context: C++
Example: Intermediate results in a computation
Example2: object used to hold a value for a reference to const argument

Name: A storage class
Definition: An object either static or automatic
Page: 167
Chapter: 6
Section: 4.2
Context: C++

Name: A full expression
Definition: An expression that is not part of another expression
Page: 167
Chapter: 6
Section: 4.2
Context: C++

Instruction: using t = u;
Page: 168
Meaning: Declares that t is a type equal to u
Language: C++
Chapter: 6
Section: 5
Name: alias declaration
Variables: u a type
Abbreviation: typedef u t;