Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::error_code::error_code

      From cppreference.com
      <cpp‎ |error‎ |error code
       
       
      Utilities library
       
      Diagnostics library
       
       
      error_code()noexcept;
      (1)(since C++11)
      error_code(int ec,const error_category& ecat)noexcept;
      (2)(since C++11)
      template<class ErrorCodeEnum>
      error_code( ErrorCodeEnum e)noexcept;
      (3)(since C++11)
      error_code(const error_code& other)=default;
      (4)(since C++11)
      (implicitly declared)
      error_code( error_code&& other)=default;
      (5)(since C++11)
      (implicitly declared)

      Constructs new error code.

      1) Constructs error code with default value. Equivalent toerror_code(0,std::system_category()).
      2) Constructs error code withec as the platform-dependent error code andecat as the correspondingerror category.
      3) Constructs error code from an error code enume. Equivalent tomake_error_code(e), wheremake_error_code is only found byargument-dependent lookup. This overload participates in overload resolution only ifstd::is_error_code_enum<ErrorCodeEnum>::value istrue.
      4,5) Implicitly defined copy constructor and move constructor. Initializes the error code with the contents of theother.

      [edit]Parameters

      other - another error code to initialize with
      ec - platform dependent error code to construct with
      ecat - error category corresponding toec
      e - error code enum to construct with

      [edit]Defect reports

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

      DRApplied toBehavior as publishedCorrect behavior
      LWG 3629C++11onlystd::make_error_code overloads were usedADL-found overloads are used

      [edit]See also

      creates error code value forerrc enume
      (function)[edit]
      constructs an iostream error code
      (function)[edit]
      constructs a future error code
      (function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/error/error_code/error_code&oldid=168922"

      [8]ページ先頭

      ©2009-2025 Movatter.jp