Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::make_error_condition(std::io_errc)

      From cppreference.com
      <cpp‎ |io‎ |io errc
       
       
       
      std::io_errc
      Non-member functions
      make_error_condition(std::io_errc)
      (C++11)
      Helper classes
       
      Defined in header<ios>
      std::error_condition make_error_condition(std::io_errc e)noexcept;
      (since C++11)

      Constructs anstd::error_condition object from a value of typestd::io_errc as if byreturnstd::error_condition(static_cast<int>(e),std::iostream_category()).

      Contents

      [edit]Parameters

      e - error code number

      [edit]Return value

      A value of typestd::error_condition that holds the error code number frome associated with the error category"iostream".

      [edit]Example

      Run this code
      #include <iostream>#include <system_error> int main(){std::error_condition ec=std::make_error_condition(std::io_errc::stream);std::cout<<"error condition for io_errc::stream has value "<< ec.value()<<"\nand message\""<< ec.message()<<"\"\n";}

      Output:

      error condition for io_errc::stream has value 1and message "unspecified iostream_category error"

      [edit]Defect reports

      The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

      DRApplied toBehavior as publishedCorrect behavior
      LWG 2087C++11make_error_condition(io_errc) was not declarednoexceptdeclarednoexcept

      [edit]See also

      holds a portable error code
      (class)[edit]
      (C++11)
      the IO stream error codes
      (enum)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/io/io_errc/make_error_condition&oldid=157070"

      [8]ページ先頭

      ©2009-2025 Movatter.jp