名稱空間
變體
操作

標準庫標頭檔案 <cstdbool> (C++11)(直到 C++20), <stdbool.h> (C++11)

來自 cppreference.com
 
 
標準庫標頭檔案
演算法
<algorithm>
<numeric>
字串
<cctype>
<cstring>
<cuchar> (C++11)
<cwchar>
<cwctype>
<string_view> (C++17)
<string>
文字處理
<clocale>
<codecvt> (C++11/17/26*)
<locale>
<regex> (C++11)
<text_encoding> (C++26)   
數值
<cfenv> (C++11)
<cmath>
<complex>
<linalg> (C++26)
<numbers> (C++20)
<random> (C++11)
<simd> (C++26)
<valarray>
時間
<chrono> (C++11)
<ctime>
C 相容性
<ccomplex> (C++11/17/20*)
<ciso646> (直到 C++20)
<cstdalign> (C++11/17/20*)
<cstdbool> (C++11/17/20*)
<ctgmath> (C++11/17/20*)
 

此標頭檔案最初是 C 標準庫中的 <stdbool.h>

相容性標頭檔案。truefalsebool 在 C++ 中是關鍵字,但在 C23 之前它們不是 C 中的關鍵字。

__bool_true_false_are_defined
(C++11)(已棄用)
C 相容性宏常量,擴充套件為整型字面量 1
(宏常量) [編輯]

[編輯] 注意

<cstdbool> 在 C++17 中已棄用,在 C++20 中已移除。相應的 <stdbool.h> 在 C++20 中仍然可用。

[編輯] 缺陷報告

下列更改行為的缺陷報告追溯地應用於以前出版的 C++ 標準。

缺陷報告 應用於 釋出時的行為 正確的行為
LWG 3827 C++11 C 程式不再需要相容性宏
__bool_true_false_are_defined 自 C23 起
在 C++ 中棄用此