From Jason Turner

[namespace.std]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp6nw8gyfj/{from.md → to.md} +48 -12
tmp/tmp6nw8gyfj/{from.md → to.md} RENAMED
@@ -1,14 +1,21 @@
1
  ##### Namespace `std` <a id="namespace.std">[[namespace.std]]</a>
2
 
3
- The behavior of a C++program is undefined if it adds declarations or
4
- definitions to namespace `std` or to a namespace within namespace `std`
5
- unless otherwise specified. A program may add a template specialization
6
- for any standard library template to namespace `std` only if the
7
- declaration depends on a user-defined type and the specialization meets
8
- the standard library requirements for the original template and is not
9
- explicitly prohibited.[^21]
 
 
 
 
 
 
 
10
 
11
  The behavior of a C++ program is undefined if it declares
12
 
13
  - an explicit specialization of any member function of a standard
14
  library class template, or
@@ -16,13 +23,42 @@ The behavior of a C++program is undefined if it declares
16
  standard library class or class template, or
17
  - an explicit or partial specialization of any member class template of
18
  a standard library class or class template, or
19
  - a deduction guide for any standard library class template.
20
 
21
- A program may explicitly instantiate a template defined in the standard
22
- library only if the declaration depends on the name of a user-defined
23
- type and the instantiation meets the standard library requirements for
24
- the original template.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
  A translation unit shall not declare namespace `std` to be an inline
27
- namespace ([[namespace.def]]).
28
 
 
1
  ##### Namespace `std` <a id="namespace.std">[[namespace.std]]</a>
2
 
3
+ Unless otherwise specified, the behavior of a C++ program is undefined
4
+ if it adds declarations or definitions to namespace `std` or to a
5
+ namespace within namespace `std`.
6
+
7
+ Unless explicitly prohibited, a program may add a template
8
+ specialization for any standard library class template to namespace
9
+ `std` provided that (a) the added declaration depends on at least one
10
+ program-defined type and (b) the specialization meets the standard
11
+ library requirements for the original template.[^21]
12
+
13
+ The behavior of a C++ program is undefined if it declares an explicit or
14
+ partial specialization of any standard library variable template, except
15
+ where explicitly permitted by the specification of that variable
16
+ template.
17
 
18
  The behavior of a C++ program is undefined if it declares
19
 
20
  - an explicit specialization of any member function of a standard
21
  library class template, or
 
23
  standard library class or class template, or
24
  - an explicit or partial specialization of any member class template of
25
  a standard library class or class template, or
26
  - a deduction guide for any standard library class template.
27
 
28
+ A program may explicitly instantiate a class template defined in the
29
+ standard library only if the declaration (a) depends on the name of at
30
+ least one program-defined type and (b) the instantiation meets the
31
+ standard library requirements for the original template.
32
+
33
+ Let `F` denote a standard library function [[global.functions]], a
34
+ standard library static member function, or an instantiation of a
35
+ standard library function template. Unless `F` is designated an
36
+ *addressable function*, the behavior of a C++ program is unspecified
37
+ (possibly ill-formed) if it explicitly or implicitly attempts to form a
38
+ pointer to `F`.
39
+
40
+ [*Note 1*: Possible means of forming such pointers include application
41
+ of the unary `&` operator [[expr.unary.op]], `addressof`
42
+ [[specialized.addressof]], or a function-to-pointer standard conversion
43
+ [[conv.func]]. — *end note*]
44
+
45
+ Moreover, the behavior of a C++ program is unspecified (possibly
46
+ ill-formed) if it attempts to form a reference to `F` or if it attempts
47
+ to form a pointer-to-member designating either a standard library
48
+ non-static member function [[member.functions]] or an instantiation of a
49
+ standard library member function template.
50
+
51
+ Other than in namespace `std` or in a namespace within namespace `std`,
52
+ a program may provide an overload for any library function template
53
+ designated as a *customization point*, provided that (a) the overload’s
54
+ declaration depends on at least one user-defined type and (b) the
55
+ overload meets the standard library requirements for the customization
56
+ point. [^22]
57
+
58
+ [*Note 2*: This permits a (qualified or unqualified) call to the
59
+ customization point to invoke the most appropriate overload for the
60
+ given arguments. — *end note*]
61
 
62
  A translation unit shall not declare namespace `std` to be an inline
63
+ namespace [[namespace.def]].
64