Files
2025-10-25 03:02:53 +03:00

9.8 KiB
Raw Permalink Blame History

[reserved.names]

16 Library introduction [library]

16.4 Library-wide requirements [requirements]

16.4.5 Constraints on programs [constraints]

16.4.5.3 Reserved names [reserved.names]

16.4.5.3.1 General [reserved.names.general]

1

#

The C++ standard library reserves the following kinds of names:

macros

global names

names with external linkage

2

#

If a program declares or defines a name in a context where it is reserved, other than as explicitly allowed by [library], its behavior is undefined.

16.4.5.3.2 Zombie names [zombie.names]

1

#

In namespace std, the names shown in Table 38 are reserved for previous standardization:

Table 38 — Zombie names in namespace std [tab:zombie.names.std]

🔗
auto_ptr
generate_header pointer_to_binary_function
🔗
auto_ptr_ref
get_pointer_safety pointer_to_unary_function
🔗
binary_function
get_temporary_buffer ptr_fun
🔗
binary_negate
get_unexpected random_shuffle
🔗
bind1st
gets raw_storage_iterator
🔗
bind2nd
is_literal_type result_of
🔗
binder1st
is_literal_type_v result_of_t
🔗
binder2nd
istrstream return_temporary_buffer
🔗
codecvt_mode
little_endian set_unexpected
🔗
codecvt_utf16
mem_fun1_ref_t strstream
🔗
codecvt_utf8
mem_fun1_t strstreambuf
🔗
codecvt_utf8_utf16
mem_fun_ref_t unary_function
🔗
const_mem_fun1_ref_t
mem_fun_ref unary_negate
🔗
const_mem_fun1_t
mem_fun_t uncaught_exception
🔗
const_mem_fun_ref_t
mem_fun undeclare_no_pointers
🔗
const_mem_fun_t
not1 undeclare_reachable
🔗
consume_header
not2 unexpected_handler
🔗
declare_no_pointers
ostrstream wbuffer_convert
🔗
declare_reachable
pointer_safety wstring_convert

2

#

The names shown in Table 39 are reserved as members for previous standardization, and may not be used as a name for object-like macros in portable code:

Table 39 — Zombie object-like macros [tab:zombie.names.objmacro]

🔗
argument_type
op second_argument_type
🔗
first_argument_type
open_mode seek_dir
🔗
io_state
preferred strict

3

#

The names shown in Table 40 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 — Zombie function-like macros [tab:zombie.names.fnmacro]

🔗
converted
freeze from_bytes pcount stossc to_bytes

4

#

The header names shown in Table 41 are reserved for previous standardization:

Table 41 — Zombie headers [tab:zombie.names.header]

🔗
🔗

16.4.5.3.3 Macro names [macro.names]

1

#

A translation unit that includes a standard library header shall not#define or #undef names declared in any standard library header.

16.4.5.3.4 External linkage [extern.names]

1

#

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 both in namespace std and in the global namespace.

2

#

Eachglobal function signature declared withexternal linkage in a header is reserved to the implementation to designate that function signature withexternal linkage.153

3

#

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.

4

#

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 or as a name of namespace scope in the global namespace.

152)152)

The list of such reserved names includeserrno, declared or defined in .

153)153)

The list of such reserved function signatures with external linkage includessetjmp(jmp_buf), declared or defined in , andva_end(va_list), declared or defined in.

154)154)

The function signatures declared in,, and are always reserved, notwithstanding the restrictions imposed in subclause 4.5.1 of Amendment 1 to the C Standard for these headers.

16.4.5.3.5 Types [extern.types]

1

#

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.

16.4.5.3.6 User-defined literal suffixes [usrlit.suffix]

1

#

Literal suffix identifiers ([over.literal]) that do not start with an underscore are reserved for future standardization.

Literal suffix identifiers that contain a double underscore__are reserved for use by C++ implementations.