<system_error>

std::is_error_code_enum

template <class T>struct is_error_code_enum : public false_type {};
error_code 列舉標誌

這是一個 traits 類,用於識別某個型別是否是error code enum型別,從而能用於構造或賦值給 error_code 型別的物件。

標準標頭檔案僅提供了預設定義,它簡單地繼承自 false_type。但它應該被特化,繼承自 true_type,以便能夠從error code enum型別構造 error_code 物件。標準的錯誤條件型別 io_errcfuture_errc 繼承了 true_type

模板引數

T
一個型別。

成員型別

繼承自 integral_constantis_falseis_trueintegral_constant 例項化的 typedef)
成員型別定義
value_typebool
型別either true_type or false_type

成員常量

繼承自 integral_constantis_falseis_trueintegral_constant 例項化的 typedef)
成員常量定義
either true or false

成員函式

繼承自 integral_constantis_falseis_trueintegral_constant 例項化的 typedef)