Files
cppdraft_translate/cppdraft/reserved/names.md
2025-10-25 03:02:53 +03:00

188 lines
9.8 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[reserved.names]
# 16 Library introduction [[library]](./#library)
## 16.4 Library-wide requirements [[requirements]](requirements#reserved.names)
### 16.4.5 Constraints on programs [[constraints]](constraints#reserved.names)
#### 16.4.5.3 Reserved names [reserved.names]
#### [16.4.5.3.1](#general) General [[reserved.names.general]](reserved.names.general)
[1](#general-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3133)
The C++ standard library reserves the following kinds of names:
- [(1.1)](#general-1.1)
macros
- [(1.2)](#general-1.2)
global names
- [(1.3)](#general-1.3)
names with external linkage
[2](#general-2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3141)
If a program declares or defines a name in a context where it is
reserved, other than as explicitly allowed by [[library]](library "16Library introduction"), its behavior is
undefined[.](#general-2.sentence-1)
#### [16.4.5.3.2](#zombie.names) Zombie names [[zombie.names]](zombie.names)
[1](#zombie.names-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3152)
In namespace std, the names shown in Table [38](#tab:zombie.names.std "Table 38: Zombie names in namespace std") are
reserved for previous standardization:
Table [38](#tab:zombie.names.std) — Zombie names in namespace std [[tab:zombie.names.std]](./tab:zombie.names.std)
| [🔗](#tab:zombie.names.std-row-1)<br> auto_ptr | generate_header | pointer_to_binary_function |
| --- | --- | --- |
| [🔗](#tab:zombie.names.std-row-2)<br> auto_ptr_ref | get_pointer_safety | pointer_to_unary_function |
| [🔗](#tab:zombie.names.std-row-3)<br> binary_function | get_temporary_buffer | ptr_fun |
| [🔗](#tab:zombie.names.std-row-4)<br> binary_negate | get_unexpected | random_shuffle |
| [🔗](#tab:zombie.names.std-row-5)<br> bind1st | gets | raw_storage_iterator |
| [🔗](#tab:zombie.names.std-row-6)<br> bind2nd | is_literal_type | result_of |
| [🔗](#tab:zombie.names.std-row-7)<br> binder1st | is_literal_type_v | result_of_t |
| [🔗](#tab:zombie.names.std-row-8)<br> binder2nd | istrstream | return_temporary_buffer |
| [🔗](#tab:zombie.names.std-row-9)<br> codecvt_mode | little_endian | set_unexpected |
| [🔗](#tab:zombie.names.std-row-10)<br> codecvt_utf16 | mem_fun1_ref_t | strstream |
| [🔗](#tab:zombie.names.std-row-11)<br> codecvt_utf8 | mem_fun1_t | strstreambuf |
| [🔗](#tab:zombie.names.std-row-12)<br> codecvt_utf8_utf16 | mem_fun_ref_t | unary_function |
| [🔗](#tab:zombie.names.std-row-13)<br> const_mem_fun1_ref_t | mem_fun_ref | unary_negate |
| [🔗](#tab:zombie.names.std-row-14)<br> const_mem_fun1_t | mem_fun_t | uncaught_exception |
| [🔗](#tab:zombie.names.std-row-15)<br> const_mem_fun_ref_t | mem_fun | undeclare_no_pointers |
| [🔗](#tab:zombie.names.std-row-16)<br> const_mem_fun_t | not1 | undeclare_reachable |
| [🔗](#tab:zombie.names.std-row-17)<br> consume_header | not2 | unexpected_handler |
| [🔗](#tab:zombie.names.std-row-18)<br> declare_no_pointers | ostrstream | wbuffer_convert |
| [🔗](#tab:zombie.names.std-row-19)<br> declare_reachable | pointer_safety | wstring_convert |
[2](#zombie.names-2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3220)
The names shown in Table [39](#tab:zombie.names.objmacro "Table 39: Zombie object-like macros") are reserved as members for
previous standardization, and may not be used as a name for object-like macros
in portable code:
Table [39](#tab:zombie.names.objmacro) — Zombie object-like macros [[tab:zombie.names.objmacro]](./tab:zombie.names.objmacro)
| [🔗](#tab:zombie.names.objmacro-row-1)<br> argument_type | op | second_argument_type |
| --- | --- | --- |
| [🔗](#tab:zombie.names.objmacro-row-2)<br> first_argument_type | open_mode | seek_dir |
| [🔗](#tab:zombie.names.objmacro-row-3)<br> io_state | preferred | strict |
[3](#zombie.names-3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3241)
The names shown in Table [40](#tab:zombie.names.fnmacro "Table 40: Zombie function-like macros") are reserved as member functions
for previous standardization, and may not be used as a name for function-like
macros in portable code:
Table [40](#tab:zombie.names.fnmacro) — Zombie function-like macros [[tab:zombie.names.fnmacro]](./tab:zombie.names.fnmacro)
| [🔗](#tab:zombie.names.fnmacro-row-1)<br> converted | freeze | from_bytes | pcount | stossc | to_bytes |
| --- | --- | --- | --- | --- | --- |
[4](#zombie.names-4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3261)
The header names shown in Table [41](#tab:zombie.names.header "Table 41: Zombie headers") are reserved for previous
standardization:
Table [41](#tab:zombie.names.header) — Zombie headers [[tab:zombie.names.header]](./tab:zombie.names.header)
| [🔗](#tab:zombie.names.header-row-1)<br><ccomplex> | <codecvt> | <cstdbool> | <ctgmath> | <strstream> |
| --- | --- | --- | --- | --- |
| [🔗](#tab:zombie.names.header-row-2)<br><ciso646> | <cstdalign> | | | |
#### [16.4.5.3.3](#macro.names) Macro names [[macro.names]](macro.names)
[1](#macro.names-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3282)
A translation unit that includes a standard library header shall not#define or #undef names declared in any standard
library header[.](#macro.names-1.sentence-1)
#### [16.4.5.3.4](#extern.names) External linkage [[extern.names]](extern.names)
[1](#extern.names-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3291)
Each name declared as an object with external linkagein a header is reserved to the implementation to designate that library
object with external linkage,[152](#footnote-152 "The list of such reserved names includes errno, declared or defined in <cerrno>.") both in namespace std and in the global namespace[.](#extern.names-1.sentence-1)
[2](#extern.names-2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3303)
Eachglobal function signature declared withexternal linkage in a header is reserved to the
implementation to designate that function signature withexternal linkage[.](#extern.names-2.sentence-1)[153](#footnote-153 "The list of such reserved function signatures with external linkage includes setjmp(jmp_­buf), declared or defined in <csetjmp>, and va_­end(va_­list), declared or defined in <cstdarg>.")
[3](#extern.names-3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3326)
Each name from the C standard library declared with external linkageis reserved to the implementation for use as a name withextern "C" linkage,
both in namespace std and in the global namespace[.](#extern.names-3.sentence-1)
[4](#extern.names-4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3336)
Each function signature from the C standard library declared withexternal linkage
is reserved to the implementation for use as
a function signature with bothextern "C" andextern "C++" linkage,[154](#footnote-154 "The function signatures declared in <cuchar>, <cwchar>, and <cwctype> are always reserved, notwithstanding the restrictions imposed in subclause 4.5.1 of Amendment 1 to the C Standard for these headers.") or as a name of namespace scope in the global namespace[.](#extern.names-4.sentence-1)
[152)](#footnote-152)[152)](#footnoteref-152)
The list of such reserved names includeserrno, declared or defined in [<cerrno>](errno.general#header:%3ccerrno%3e "19.4.1General[errno.general]")[.](#footnote-152.sentence-1)
[153)](#footnote-153)[153)](#footnoteref-153)
The list of such reserved function
signatures with external linkage includessetjmp(jmp_buf),
declared or defined in [<csetjmp>](csetjmp.syn#header:%3ccsetjmp%3e "17.14.3Header <csetjmp> synopsis[csetjmp.syn]"),
andva_end(va_list),
declared or defined in[<cstdarg>](cstdarg.syn#header:%3ccstdarg%3e "17.14.2Header <cstdarg> synopsis[cstdarg.syn]")[.](#footnote-153.sentence-1)
[154)](#footnote-154)[154)](#footnoteref-154)
The function signatures declared in[<cuchar>](cuchar.syn#header:%3ccuchar%3e "28.7.4Header <cuchar> synopsis[cuchar.syn]"),[<cwchar>](cwchar.syn#header:%3ccwchar%3e "28.7.3Header <cwchar> synopsis[cwchar.syn]"),
and[<cwctype>](cwctype.syn#header:%3ccwctype%3e "28.7.2Header <cwctype> synopsis[cwctype.syn]") are always reserved, notwithstanding the restrictions imposed in subclause
4.5.1 of Amendment 1 to the C Standard for these headers[.](#footnote-154.sentence-1)
#### [16.4.5.3.5](#extern.types) Types [[extern.types]](extern.types)
[1](#extern.types-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3362)
For each type T from the C standard library,
the types::T andstd::T are reserved to the implementation and, when defined,::T shall be identical tostd::T[.](#extern.types-1.sentence-1)
#### [16.4.5.3.6](#usrlit.suffix) User-defined literal suffixes [[usrlit.suffix]](usrlit.suffix)
[1](#usrlit.suffix-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3375)
Literal suffix identifiers ([[over.literal]](over.literal "12.6User-defined literals")) that do not start with an underscore are reserved for future standardization[.](#usrlit.suffix-1.sentence-1)
Literal suffix identifiers that contain a double underscore__are reserved for use by C++ implementations[.](#usrlit.suffix-1.sentence-2)