C++標準ライブラリヘッダファイル
C++標準ライブラリのインタフェースは以下のヘッダファイル群により定義されます。
[編集]C 互換ヘッダ
For some of the C standard library headers of the form xxx.h, the C++ standard library both includes an identically-named header and another header of the form cxxx (all meaningful cxxx headers are listed above).
With the exception of complex.h , each xxx.h header included in the C++ standard library places in the global namespace each name that the corresponding cxxx header would have placed in the std namespace.
These headers are allowed to also declare the same names in the std namespace, and the corresponding cxxx headers are allowed to also declare the same names in the global namespace: including <cstdlib> definitely provides std::malloc and may also provide ::malloc. Including <stdlib.h> definitely provides ::malloc and may also provide std::malloc. This applies even to functions and function overloads that are not part of C standard library.
<assert.h> (廃止予定) | behaves as if each name from <cassert> is placed in global namespace |
<ctype.h> (廃止予定) | behaves as if each name from <cctype> is placed in global namespace |
<errno.h> (廃止予定) | behaves as if each name from <cerrno> is placed in global namespace |
<fenv.h> (廃止予定) | behaves as if each name from <cfenv> is placed in global namespace |
<float.h> (廃止予定) | behaves as if each name from <cfloat> is placed in global namespace |
<inttypes.h> (廃止予定) | behaves as if each name from <cinttypes> is placed in global namespace |
<limits.h> (廃止予定) | behaves as if each name from <climits> is placed in global namespace |
<locale.h> (廃止予定) | behaves as if each name from <clocale> is placed in global namespace |
<math.h> (廃止予定) | behaves as if each name from <cmath> is placed in global namespace except for names of mathematical special functions |
<setjmp.h> (廃止予定) | behaves as if each name from <csetjmp> is placed in global namespace |
<signal.h> (廃止予定) | behaves as if each name from <csignal> is placed in global namespace |
<stdarg.h> (廃止予定) | behaves as if each name from <cstdarg> is placed in global namespace |
<stddef.h> (廃止予定) | behaves as if each name from <cstddef> is placed in global namespace except for names of std::byte and related functions |
<stdint.h> (廃止予定) | behaves as if each name from <cstdint> is placed in global namespace |
<stdio.h> (廃止予定) | behaves as if each name from <cstdio> is placed in global namespace |
<stdlib.h> (廃止予定) | behaves as if each name from <cstdlib> is placed in global namespace |
<string.h> (廃止予定) | behaves as if each name from <cstring> is placed in global namespace |
<time.h> (廃止予定) | behaves as if each name from <ctime> is placed in global namespace |
<uchar.h> (廃止予定) | behaves as if each name from <cuchar> is placed in global namespace |
<wchar.h> (廃止予定) | behaves as if each name from <cwchar> is placed in global namespace |
<wctype.h> (廃止予定) | behaves as if each name from <cwctype> is placed in global namespace |
[編集]サポートされない C のヘッダ
The C headers <stdatomic.h>
, <stdnoreturn.h>
, and <threads.h>
are not included in C++ and have no cxxx equivalents.
[編集]空の C のヘッダ
The headers <complex.h>
, <ccomplex>
, <tgmath.h>
, and <ctgmath>
do not contain any content from the C standard library and instead merely include other headers from the C++ standard library. The use of all these headers is deprecated in C++.
<ccomplex> (C++11およびそれ以降)(deprecated in C++17) | simply includes the header <complex> |
<complex.h> (廃止予定) | simply includes the header <complex> |
<ctgmath> (C++11およびそれ以降)(deprecated in C++17) | simply includes the headers <complex> and <cmath>: the overloads equivalent to the contents of the C header tgmath.h are already provided by those headers |
<tgmath.h> (廃止予定) | simply includes the header <ctgmath> |
[編集]意味のない C のヘッダ
The headers <ciso646>
, <cstdalign>
, and <cstdbool>
are meaningless in C++ because the macros they provide in C are language keywords in C++.
<ciso646> | empty header. The macros that appear in iso646.h in C are keywords in C++ |
<iso646.h> (廃止予定) | behaves as if each name from <ciso646> is placed in global namespace |
<cstdalign> (C++11およびそれ以降)(deprecated in C++17) | defines one compatibility macro constant |
<stdalign.h> (廃止予定) | behaves as if each name from <cstdalign> is placed in global namespace |
<cstdbool> (C++11およびそれ以降)(deprecated in C++17) | defines one compatibility macro constant |
<stdbool.h> (廃止予定) | behaves as if each name from <cstdbool> is placed in global namespace |
[編集]関連項目
C標準ライブラリヘッダファイル の C言語リファレンス |