From Jason Turner

[description]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpwpc9m21n/{from.md → to.md} +149 -78
tmp/tmpwpc9m21n/{from.md → to.md} RENAMED
@@ -1,17 +1,19 @@
1
  ## Method of description <a id="description">[[description]]</a>
2
 
3
- This subclause describes the conventions used to specify the C++
4
- standard library. [[structure]] describes the structure of the normative
 
 
5
  [[support]] through [[thread]] and [[depr]]. [[conventions]] describes
6
  other editorial conventions.
7
 
8
  ### Structure of each clause <a id="structure">[[structure]]</a>
9
 
10
  #### Elements <a id="structure.elements">[[structure.elements]]</a>
11
 
12
- Each library clause contains the following elements, as applicable:[^1]
13
 
14
  - Summary
15
  - Requirements
16
  - Detailed specifications
17
  - References to the C standard library
@@ -76,11 +78,11 @@ Template argument requirements are sometimes referenced by name. See 
76
  [[type.descriptions]].
77
 
78
  In some cases the semantic requirements are presented as C++ code. Such
79
  code is intended as a specification of equivalence of a construct to
80
  another construct, not necessarily as the way the construct must be
81
- implemented.[^2]
82
 
83
  Required operations of any concept defined in this document need not be
84
  total functions; that is, some arguments to a required operation may
85
  result in the required semantics failing to be met.
86
 
@@ -104,43 +106,49 @@ The detailed specifications each contain the following elements:
104
  - restrictions on template arguments, if any
105
  - description of class invariants
106
  - description of function semantics
107
 
108
  Descriptions of class member functions follow the order (as
109
- appropriate):[^3]
110
 
111
  - constructor(s) and destructor
112
  - copying, moving & assignment functions
113
- - comparison functions
114
  - modifier functions
115
  - observer functions
116
  - operators and other non-member functions
117
 
118
  Descriptions of function semantics contain the following elements (as
119
- appropriate):[^4]
120
 
121
  - *Constraints:* the conditions for the function’s participation in
122
  overload resolution [[over.match]]. \[*Note 1*: Failure to meet such a
123
  condition results in the function’s silent
124
- non-viability. — *end note*] \[*Example 1*: An implementation might
125
  express such a condition via a *constraint-expression*
126
  [[temp.constr.decl]]. — *end example*]
127
  - *Mandates:* the conditions that, if not met, render the program
128
- ill-formed. \[*Example 2*: An implementation might express such a
129
  condition via the *constant-expression* in a
130
  *static_assert-declaration* [[dcl.pre]]. If the diagnostic is to be
131
  emitted only after the function has been selected by overload
132
- resolution, an implementation might express such a condition via a
133
  *constraint-expression* [[temp.constr.decl]] and also define the
134
  function as deleted. — *end example*]
135
  - *Preconditions:* the conditions that the function assumes to hold
136
- whenever it is called.
 
137
  - *Effects:* the actions performed by the function.
138
  - *Synchronization:* the synchronization operations
139
  [[intro.multithread]] applicable to the function.
140
  - *Ensures:* the conditions (sometimes termed observable results)
141
  established by the function.
 
 
 
 
 
142
  - *Returns:* a description of the value(s) returned by the function.
143
  - *Throws:* any exceptions thrown by the function, and the conditions
144
  that would cause the exception.
145
  - *Complexity:* the time and/or space complexity of the function.
146
  - *Remarks:* additional semantic constraints on the function.
@@ -170,11 +178,11 @@ definition provided by the implementation. The *required behavior*
170
  describes the semantics of a function definition provided by either the
171
  implementation or a C++ program. Where no distinction is explicitly made
172
  in the description, the behavior described is the required behavior.
173
 
174
  If the formulation of a complexity requirement calls for a negative
175
- number of operations, the actual requirement is zero operations.[^5]
176
 
177
  Complexity requirements specified in the library clauses are upper
178
  bounds, and implementations that provide better complexity guarantees
179
  meet the requirements.
180
 
@@ -188,26 +196,32 @@ Paragraphs labeled “<span class="smallcaps">See also</span>” contain
188
  cross-references to the relevant portions of other standards
189
  [[intro.refs]].
190
 
191
  ### Other conventions <a id="conventions">[[conventions]]</a>
192
 
193
- This subclause describes several editorial conventions used to describe
194
- the contents of the C++ standard library. These conventions are for
195
- describing implementation-defined types [[type.descriptions]], and
196
- member functions [[functions.within.classes]].
197
 
198
- #### Exposition-only functions <a id="expos.only.func">[[expos.only.func]]</a>
 
 
 
199
 
200
- Several function templates defined in [[support]] through [[thread]] and
201
- [[depr]] are only defined for the purpose of exposition. The declaration
202
- of such a function is followed by a comment ending in *exposition only*.
 
 
 
203
 
204
  The following are defined for exposition only to aid in the
205
  specification of the library:
206
 
207
  ``` cpp
208
- template<class T> constexpr decay_t<T> decay-copy(T&& v)
 
 
 
209
  noexcept(is_nothrow_convertible_v<T, decay_t<T>>) // exposition only
210
  { return std::forward<T>(v); }
211
 
212
  constexpr auto synth-three-way =
213
  []<class T, class U>(const T& t, const U& u)
@@ -225,49 +239,33 @@ constexpr auto synth-three-way =
225
  }
226
  };
227
 
228
  template<class T, class U=T>
229
  using synth-three-way-result = decltype(synth-three-way(declval<T&>(), declval<U&>()));
 
230
  ```
231
 
232
  #### Type descriptions <a id="type.descriptions">[[type.descriptions]]</a>
233
 
234
  ##### General <a id="type.descriptions.general">[[type.descriptions.general]]</a>
235
 
236
  The Requirements subclauses may describe names that are used to specify
237
- constraints on template arguments.[^6] These names are used in library
238
- Clauses to describe the types that may be supplied as arguments by a C++
239
- program when instantiating template components from the library.
 
 
240
 
241
  Certain types defined in [[input.output]] are used to describe
242
  implementation-defined types. They are based on other types, but with
243
  added constraints.
244
 
245
- ##### Exposition-only types <a id="expos.only.types">[[expos.only.types]]</a>
246
-
247
- Several types defined in [[support]] through [[thread]] and [[depr]] are
248
- defined for the purpose of exposition. The declaration of such a type is
249
- followed by a comment ending in *exposition only*.
250
-
251
- [*Example 1*:
252
-
253
- ``` cpp
254
- namespace std {
255
- extern "C" using some-handler = int(int, void*, double); // exposition only
256
- }
257
- ```
258
-
259
- The type placeholder `some-handler` can now be used to specify a
260
- function that takes a callback parameter with C language linkage.
261
-
262
- — *end example*]
263
-
264
  ##### Enumerated types <a id="enumerated.types">[[enumerated.types]]</a>
265
 
266
  Several types defined in [[input.output]] are *enumerated types*. Each
267
  enumerated type may be implemented as an enumeration or as a synonym for
268
- an enumeration.[^7]
269
 
270
  The enumerated type `enumerated` can be written:
271
 
272
  ``` cpp
273
  enum enumerated { V₀, V₁, V₂, V₃, … };
@@ -345,24 +343,36 @@ The following terms apply to objects and values of bitmask types:
345
  - The value *Y* *is set* in the object *X* if the expression *X* `&` *Y*
346
  is nonzero.
347
 
348
  ##### Character sequences <a id="character.seq">[[character.seq]]</a>
349
 
 
 
350
  The C standard library makes widespread use of characters and character
351
  sequences that follow a few uniform conventions:
352
 
 
 
 
 
 
 
 
 
 
 
 
 
353
  - A *letter* is any of the 26 lowercase or 26 uppercase letters in the
354
- basic execution character set.
355
- - The *decimal-point character* is the (single-byte) character used by
356
- functions that convert between a (single-byte) character sequence and
357
- a value of one of the floating-point types. It is used in the
358
- character sequence to denote the beginning of a fractional part. It is
359
- represented in [[support]] through [[thread]] and [[depr]] by a
360
- period, `'.'`, which is also its value in the `"C"` locale, but may
361
- change during program execution by a call to
362
- `setlocale(int, const char*)`,[^8] or by a change to a `locale`
363
- object, as described in [[locales]] and [[input.output]].
364
  - A *character sequence* is an array object [[dcl.array]] `A` that can
365
  be declared as `T A[N]`, where `T` is any of the types `char`,
366
  `unsigned char`, or `signed char` [[basic.fundamental]], optionally
367
  qualified by any combination of `const` or `volatile`. The initial
368
  elements of the array have defined contents up to and including an
@@ -384,10 +394,14 @@ and including the terminating null character.
384
 
385
  A *static NTBS* is an NTBS with static storage duration.[^10]
386
 
387
  ###### Multibyte strings <a id="multibyte.strings">[[multibyte.strings]]</a>
388
 
 
 
 
 
389
  A *null-terminated multibyte string*, or NTMBS, is an NTBS that
390
  constitutes a sequence of valid multibyte characters, beginning and
391
  ending in the initial shift state.[^11]
392
 
393
  A *static NTMBS* is an NTMBS with static storage duration.
@@ -400,44 +414,46 @@ while enforcing semantic requirements on that interaction.
400
 
401
  The type of a customization point object, ignoring cv-qualifiers, shall
402
  model `semiregular` [[concepts.object]].
403
 
404
  All instances of a specific customization point object type shall be
405
- equal [[concepts.equality]].
 
 
406
 
407
- The type `T` of a customization point object shall model
408
- `invocable<const T&, Args...>` [[concept.invocable]] when the types in
409
- `Args...` meet the requirements specified in that customization point
410
- object’s definition. When the types of `Args...` do not meet the
411
- customization point object’s requirements, `T` shall not have a function
412
- call operator that participates in overload resolution.
 
 
 
 
 
 
 
 
 
 
 
 
413
 
414
  Each customization point object type constrains its return type to model
415
  a particular concept.
416
 
417
- [*Note 1*: Many of the customization point objects in the library
418
- evaluate function call expressions with an unqualified name which
419
- results in a call to a program-defined function found by argument
420
- dependent name lookup [[basic.lookup.argdep]]. To preclude such an
421
- expression resulting in a call to unconstrained functions with the same
422
- name in namespace `std`, customization point objects specify that lookup
423
- for these expressions is performed in a context that includes deleted
424
- overloads matching the signatures of overloads defined in namespace
425
- `std`. When the deleted overloads are viable, program-defined overloads
426
- need be more specialized [[temp.func.order]] or more constrained
427
- [[temp.constr.order]] to be used by a customization point
428
- object. — *end note*]
429
-
430
  #### Functions within classes <a id="functions.within.classes">[[functions.within.classes]]</a>
431
 
432
  For the sake of exposition, [[support]] through [[thread]] and [[depr]]
433
  do not describe copy/move constructors, assignment operators, or
434
  (non-virtual) destructors with the same apparent semantics as those that
435
- can be generated by default ([[class.copy.ctor]],
436
- [[class.copy.assign]], [[class.dtor]]). It is unspecified whether the
437
- implementation provides explicit definitions for such member function
438
- signatures, or for virtual destructors that can be generated by default.
 
439
 
440
  #### Private members <a id="objects.within.classes">[[objects.within.classes]]</a>
441
 
442
  [[support]] through [[thread]] and [[depr]] do not specify the
443
  representation of classes, and intentionally omit specification of class
@@ -457,5 +473,60 @@ streambuf* sb; // exposition only
457
  ```
458
 
459
  An implementation may use any technique that provides equivalent
460
  observable behavior.
461
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ## Method of description <a id="description">[[description]]</a>
2
 
3
+ ### General <a id="description.general">[[description.general]]</a>
4
+
5
+ Subclause [[description]] describes the conventions used to specify the
6
+ C++ standard library. [[structure]] describes the structure of
7
  [[support]] through [[thread]] and [[depr]]. [[conventions]] describes
8
  other editorial conventions.
9
 
10
  ### Structure of each clause <a id="structure">[[structure]]</a>
11
 
12
  #### Elements <a id="structure.elements">[[structure.elements]]</a>
13
 
14
+ Each library clause contains the following elements, as applicable:[^2]
15
 
16
  - Summary
17
  - Requirements
18
  - Detailed specifications
19
  - References to the C standard library
 
78
  [[type.descriptions]].
79
 
80
  In some cases the semantic requirements are presented as C++ code. Such
81
  code is intended as a specification of equivalence of a construct to
82
  another construct, not necessarily as the way the construct must be
83
+ implemented.[^3]
84
 
85
  Required operations of any concept defined in this document need not be
86
  total functions; that is, some arguments to a required operation may
87
  result in the required semantics failing to be met.
88
 
 
106
  - restrictions on template arguments, if any
107
  - description of class invariants
108
  - description of function semantics
109
 
110
  Descriptions of class member functions follow the order (as
111
+ appropriate):[^4]
112
 
113
  - constructor(s) and destructor
114
  - copying, moving & assignment functions
115
+ - comparison operator functions
116
  - modifier functions
117
  - observer functions
118
  - operators and other non-member functions
119
 
120
  Descriptions of function semantics contain the following elements (as
121
+ appropriate):[^5]
122
 
123
  - *Constraints:* the conditions for the function’s participation in
124
  overload resolution [[over.match]]. \[*Note 1*: Failure to meet such a
125
  condition results in the function’s silent
126
+ non-viability. — *end note*] \[*Example 1*: An implementation can
127
  express such a condition via a *constraint-expression*
128
  [[temp.constr.decl]]. — *end example*]
129
  - *Mandates:* the conditions that, if not met, render the program
130
+ ill-formed. \[*Example 2*: An implementation can express such a
131
  condition via the *constant-expression* in a
132
  *static_assert-declaration* [[dcl.pre]]. If the diagnostic is to be
133
  emitted only after the function has been selected by overload
134
+ resolution, an implementation can express such a condition via a
135
  *constraint-expression* [[temp.constr.decl]] and also define the
136
  function as deleted. — *end example*]
137
  - *Preconditions:* the conditions that the function assumes to hold
138
+ whenever it is called; violation of any preconditions results in
139
+ undefined behavior.
140
  - *Effects:* the actions performed by the function.
141
  - *Synchronization:* the synchronization operations
142
  [[intro.multithread]] applicable to the function.
143
  - *Ensures:* the conditions (sometimes termed observable results)
144
  established by the function.
145
+ - *Result:* for a *typename-specifier*, a description of the named type;
146
+ for an *expression*, a description of the type of the expression; the
147
+ expression is an lvalue if the type is an lvalue reference type, an
148
+ xvalue if the type is an rvalue reference type, and a prvalue
149
+ otherwise.
150
  - *Returns:* a description of the value(s) returned by the function.
151
  - *Throws:* any exceptions thrown by the function, and the conditions
152
  that would cause the exception.
153
  - *Complexity:* the time and/or space complexity of the function.
154
  - *Remarks:* additional semantic constraints on the function.
 
178
  describes the semantics of a function definition provided by either the
179
  implementation or a C++ program. Where no distinction is explicitly made
180
  in the description, the behavior described is the required behavior.
181
 
182
  If the formulation of a complexity requirement calls for a negative
183
+ number of operations, the actual requirement is zero operations.[^6]
184
 
185
  Complexity requirements specified in the library clauses are upper
186
  bounds, and implementations that provide better complexity guarantees
187
  meet the requirements.
188
 
 
196
  cross-references to the relevant portions of other standards
197
  [[intro.refs]].
198
 
199
  ### Other conventions <a id="conventions">[[conventions]]</a>
200
 
201
+ #### General <a id="conventions.general">[[conventions.general]]</a>
 
 
 
202
 
203
+ Subclause [[conventions]] describes several editorial conventions used
204
+ to describe the contents of the C++ standard library. These conventions
205
+ are for describing implementation-defined types [[type.descriptions]],
206
+ and member functions [[functions.within.classes]].
207
 
208
+ #### Exposition-only entities, etc. <a id="expos.only.entity">[[expos.only.entity]]</a>
209
+
210
+ Several entities and *typedef-name*s defined in [[support]] through
211
+ [[thread]] and [[depr]] are only defined for the purpose of exposition.
212
+ The declaration of such an entity or *typedef-name* is followed by a
213
+ comment ending in *exposition only*.
214
 
215
  The following are defined for exposition only to aid in the
216
  specification of the library:
217
 
218
  ``` cpp
219
+ namespace std {
220
+ template<class T>
221
+ requires convertible_to<T, decay_t<T>>
222
+ constexpr decay_t<T> decay-copy(T&& v)
223
  noexcept(is_nothrow_convertible_v<T, decay_t<T>>) // exposition only
224
  { return std::forward<T>(v); }
225
 
226
  constexpr auto synth-three-way =
227
  []<class T, class U>(const T& t, const U& u)
 
239
  }
240
  };
241
 
242
  template<class T, class U=T>
243
  using synth-three-way-result = decltype(synth-three-way(declval<T&>(), declval<U&>()));
244
+ }
245
  ```
246
 
247
  #### Type descriptions <a id="type.descriptions">[[type.descriptions]]</a>
248
 
249
  ##### General <a id="type.descriptions.general">[[type.descriptions.general]]</a>
250
 
251
  The Requirements subclauses may describe names that are used to specify
252
+ constraints on template arguments.[^7]
253
+
254
+ These names are used in library Clauses to describe the types that may
255
+ be supplied as arguments by a C++ program when instantiating template
256
+ components from the library.
257
 
258
  Certain types defined in [[input.output]] are used to describe
259
  implementation-defined types. They are based on other types, but with
260
  added constraints.
261
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  ##### Enumerated types <a id="enumerated.types">[[enumerated.types]]</a>
263
 
264
  Several types defined in [[input.output]] are *enumerated types*. Each
265
  enumerated type may be implemented as an enumeration or as a synonym for
266
+ an enumeration.[^8]
267
 
268
  The enumerated type `enumerated` can be written:
269
 
270
  ``` cpp
271
  enum enumerated { V₀, V₁, V₂, V₃, … };
 
343
  - The value *Y* *is set* in the object *X* if the expression *X* `&` *Y*
344
  is nonzero.
345
 
346
  ##### Character sequences <a id="character.seq">[[character.seq]]</a>
347
 
348
+ ###### General <a id="character.seq.general">[[character.seq.general]]</a>
349
+
350
  The C standard library makes widespread use of characters and character
351
  sequences that follow a few uniform conventions:
352
 
353
+ - Properties specified as *locale-specific* may change during program
354
+ execution by a call to `setlocale(int, const char*)` [[clocale.syn]],
355
+ or by a change to a `locale` object, as described in [[locales]] and
356
+ [[input.output]].
357
+ - The *execution character set* and the *execution wide-character set*
358
+ are supersets of the basic literal character set [[lex.charset]]. The
359
+ encodings of the execution character sets and the sets of additional
360
+ elements (if any) are locale-specific. Each element of the execution
361
+ wide-character set is encoded as a single code unit representable by a
362
+ value of type `wchar_t`. \[*Note 1*: The encodings of the execution
363
+ character sets can be unrelated to any literal
364
+ encoding. — *end note*]
365
  - A *letter* is any of the 26 lowercase or 26 uppercase letters in the
366
+ basic character set.
367
+ - The *decimal-point character* is the locale-specific (single-byte)
368
+ character used by functions that convert between a (single-byte)
369
+ character sequence and a value of one of the floating-point types. It
370
+ is used in the character sequence to denote the beginning of a
371
+ fractional part. It is represented in [[support]] through [[thread]]
372
+ and [[depr]] by a period, `'.'`, which is also its value in the `"C"`
373
+ locale.
 
 
374
  - A *character sequence* is an array object [[dcl.array]] `A` that can
375
  be declared as `T A[N]`, where `T` is any of the types `char`,
376
  `unsigned char`, or `signed char` [[basic.fundamental]], optionally
377
  qualified by any combination of `const` or `volatile`. The initial
378
  elements of the array have defined contents up to and including an
 
394
 
395
  A *static NTBS* is an NTBS with static storage duration.[^10]
396
 
397
  ###### Multibyte strings <a id="multibyte.strings">[[multibyte.strings]]</a>
398
 
399
+ A *multibyte character* is a sequence of one or more bytes representing
400
+ the code unit sequence for an encoded character of the execution
401
+ character set.
402
+
403
  A *null-terminated multibyte string*, or NTMBS, is an NTBS that
404
  constitutes a sequence of valid multibyte characters, beginning and
405
  ending in the initial shift state.[^11]
406
 
407
  A *static NTMBS* is an NTMBS with static storage duration.
 
414
 
415
  The type of a customization point object, ignoring cv-qualifiers, shall
416
  model `semiregular` [[concepts.object]].
417
 
418
  All instances of a specific customization point object type shall be
419
+ equal [[concepts.equality]]. The effects of invoking different instances
420
+ of a specific customization point object type on the same arguments are
421
+ equivalent.
422
 
423
+ The type `T` of a customization point object, ignoring *cv-qualifier*s,
424
+ shall model `invocable<T&, Args...>`, `invocable<const T&, Args...>`,
425
+ `invocable<T, Args...>`, and `invocable<const T, Args...>`
426
+ [[concept.invocable]] when the types in `Args...` meet the requirements
427
+ specified in that customization point object’s definition. When the
428
+ types of `Args...` do not meet the customization point object’s
429
+ requirements, `T` shall not have a function call operator that
430
+ participates in overload resolution.
431
+
432
+ For a given customization point object `o`, let `p` be a variable
433
+ initialized as if by `auto p = o;`. Then for any sequence of arguments
434
+ `args...`, the following expressions have effects equivalent to
435
+ `o(args...)`:
436
+
437
+ - `p(args...)`
438
+ - `as_const(p)(args...)`
439
+ - `std::move(p)(args...)`
440
+ - `std::move(as_const(p))(args...)`
441
 
442
  Each customization point object type constrains its return type to model
443
  a particular concept.
444
 
 
 
 
 
 
 
 
 
 
 
 
 
 
445
  #### Functions within classes <a id="functions.within.classes">[[functions.within.classes]]</a>
446
 
447
  For the sake of exposition, [[support]] through [[thread]] and [[depr]]
448
  do not describe copy/move constructors, assignment operators, or
449
  (non-virtual) destructors with the same apparent semantics as those that
450
+ can be generated by default
451
+ [[class.copy.ctor]], [[class.copy.assign]], [[class.dtor]]. It is
452
+ unspecified whether the implementation provides explicit definitions for
453
+ such member function signatures, or for virtual destructors that can be
454
+ generated by default.
455
 
456
  #### Private members <a id="objects.within.classes">[[objects.within.classes]]</a>
457
 
458
  [[support]] through [[thread]] and [[depr]] do not specify the
459
  representation of classes, and intentionally omit specification of class
 
473
  ```
474
 
475
  An implementation may use any technique that provides equivalent
476
  observable behavior.
477
 
478
+ #### Freestanding items <a id="freestanding.item">[[freestanding.item]]</a>
479
+
480
+ A *freestanding item* is a declaration, entity, *typedef-name*, or macro
481
+ that is required to be present in a freestanding implementation and a
482
+ hosted implementation.
483
+
484
+ Unless otherwise specified, the requirements on freestanding items for a
485
+ freestanding implementation are the same as the corresponding
486
+ requirements for a hosted implementation, except that not all of the
487
+ members of the namespaces are required to be present.
488
+
489
+ [*Note 1*: This implies that freestanding item enumerations have the
490
+ same enumerators on freestanding implementations and hosted
491
+ implementations. Furthermore, class types have the same members and
492
+ class templates have the same deduction guides on freestanding
493
+ implementations and hosted implementations. — *end note*]
494
+
495
+ A declaration in a header synopsis is a freestanding item if
496
+
497
+ - it is followed by a comment that includes *freestanding*, or
498
+ - the header synopsis begins with a comment that includes *all
499
+ freestanding*.
500
+
501
+ An entity or *typedef-name* is a freestanding item if it is:
502
+
503
+ - introduced by a declaration that is a freestanding item,
504
+ - an enclosing namespace of a freestanding item,
505
+ - a friend of a freestanding item,
506
+ - denoted by a *typedef-name* that is a freestanding item, or
507
+ - denoted by an alias template that is a freestanding item.
508
+
509
+ A macro is a freestanding item if it is defined in a header synopsis and
510
+
511
+ - the definition is followed by a comment that includes *freestanding*,
512
+ or
513
+ - the header synopsis begins with a comment that includes *all
514
+ freestanding*.
515
+
516
+ [*Example 1*:
517
+
518
+ ``` cpp
519
+ #define NULL see below // freestanding
520
+ ```
521
+
522
+ — *end example*]
523
+
524
+ [*Example 2*:
525
+
526
+ ``` cpp
527
+ // all freestanding
528
+ namespace std {
529
+ ```
530
+
531
+ — *end example*]
532
+