首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::error_code::error_code

error_code();

(1)

(since C++11)

error_code( int ec, const error_category& ecat );

(2)

(since C++11)

template< class ErrorCodeEnum > error_code( ErrorCodeEnum e );

(3)

(since C++11)

构造新的错误代码。

1%29构造具有默认值的错误代码。相当于error_code(0,std::system_category())...

2%29构造错误代码ec作为平台相关的错误代码和ecat作为相应的错误类别。

3%29从错误代码枚举构造错误代码。e相当于*this = make_error_code(e)只有在下列情况下,重载才会参与过载解决方案std::is_error_code_enum<ErrorCodeEnum>::value==true...

参数

ec

-

platform dependent error code to construct with

ecat

-

error category corresponding to ec

e

-

error code enum to construct with

例外

noexcept规格:

noexcept

另见

make_error_code(std::errc) (C++11)

constructs an std::errc error code (function)

make_error_code(std::io_errc) (C++11)

constructs an iostream error code (function)

make_error_code(std::future_errc) (C++11)

constructs a future error code (function)

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券