cplusplus
.com
教程
參考
文章
論壇
C++
教程
參考
文章
論壇
參考
C 庫
<cassert> (assert.h)
<cctype> (ctype.h)
<cerrno> (errno.h)
C++11
<cfenv> (fenv.h)
<cfloat> (float.h)
C++11
<cinttypes> (inttypes.h)
<ciso646> (iso646.h)
<climits> (limits.h)
<clocale> (locale.h)
<cmath> (math.h)
<csetjmp> (setjmp.h)
<csignal> (signal.h)
<cstdarg> (stdarg.h)
C++11
<cstdbool> (stdbool.h)
<cstddef> (stddef.h)
C++11
<cstdint> (stdint.h)
<cstdio> (stdio.h)
<cstdlib> (stdlib.h)
<cstring> (string.h)
C++11
<ctgmath> (tgmath.h)
<ctime> (time.h)
C++11
<cuchar> (uchar.h)
<cwchar> (wchar.h)
<cwctype> (wctype.h)
容器
C++11
<array>
<deque>
C++11
<forward_list>
<list>
<map>
<queue>
<set>
<stack>
C++11
<unordered_map>
C++11
<unordered_set>
<vector>
輸入/輸出
<fstream>
<iomanip>
<ios>
<iosfwd>
<iostream>
<istream>
<ostream>
<sstream>
<streambuf>
多執行緒
C++11
<atomic>
C++11
<condition_variable>
C++11
<future>
C++11
<mutex>
C++11
<thread>
其他
<algorithm>
<bitset>
C++11
<chrono>
C++11
<codecvt>
<complex>
<exception>
<functional>
C++11
<initializer_list>
<iterator>
<limits>
<locale>
<memory>
<new>
<numeric>
C++11
<random>
C++11
<ratio>
C++11
<regex>
<stdexcept>
<string>
C++11
<system_error>
C++11
<tuple>
C++11
<type_traits>
C++11
<typeindex>
<typeinfo>
<utility>
<valarray>
<system_error>
類
C++11
error_category
C++11
error_code
C++11
error_condition
C++11
is_error_code_enum
C++11
is_error_condition_enum
C++11
system_error
列舉類
C++11
errc
函式
C++11
generic_category
C++11
make_error_code
C++11
make_error_condition
C++11
system_category
參考
<system_error>
標頭檔案
<system_error>
系統錯誤
此標頭檔案定義了一系列標準化元素,用於報告源自作業系統或其他底層操作的錯誤條件。
大多數此類錯誤由單個整數值標識,該值有時是特定於系統的。類
error_code
封裝並保留這些系統生成的值,將它們與
error_category
相關聯。
這些物件可以與
error_condition
型別的物件進行比較,後者是一種非常相似的型別,旨在以可移植的方式表示相同的錯誤。這樣,對系統的庫呼叫可能會產生
error_code
值(保留了系統特定的值),而程式可以將它們與
error_condition
物件(在系統之間是可移植的)進行比較。
error_category
物件標識了不同的
錯誤碼
集合,並確定了
錯誤碼
和
錯誤條件
之間的對應關係。
此標頭檔案定義了兩個類別:
generic_category
和
system_category
。其他庫可能會定義額外的
錯誤類別
(例如,在
<ios>
中定義的標準
iostream_category
)。
類
system_error
是一種標準的
異常
型別,它攜帶一個
error_code
物件。
類
error_category
錯誤類別
(抽象類)
error_code
錯誤碼
(類)
error_condition
錯誤條件
(類)
system_error
系統錯誤異常
(類)
特性類
is_error_code_enum
error_code 列舉標誌
(類)
is_error_condition_enum
error_condition 列舉標誌
(類)
列舉類
errc
通用錯誤條件
(列舉類)
函式
分類
generic_category
返回通用類別
(函式)
system_category
返回系統類別
(函式)
建構函式幫助器
make_error_code
建立錯誤碼
(函式)
make_error_condition
建立錯誤條件
(函式)