• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

    最終更新日時(UTC):
    が更新

    履歴 編集

    function
    <system_error>

    std::error_category::default_error_condition

    virtual error_condition default_error_condition(int ev) const noexcept;
    

    概要

    パラメータevと自身のerror_categoryから成るerror_conditionを生成して返す

    戻り値

    error_condition(ev, *this)

    例外

    投げない

    #include <iostream>
    #include <system_error>
    #include <string>
    #include <cerrno>
    
    int main()
    {
      const std::error_category& cat = std::generic_category();
      std::error_condition ed = cat.default_error_condition(ENOTDIR);
    
      std::cout << ed.value() << std::endl;
      std::cout << ed.message() << std::endl;
    }
    

    出力

    20
    Not a directory
    

    バージョン

    言語

    • C++11

    処理系

    参照