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

std::invalid_argument

Defined in header <stdexcept>

?

?

class invalid_argument;

?

?

定义要作为异常抛出的对象类型。它报告由于参数值未被接受而产生的错误。

引发此异常std::bitset::bitset,以及std::stoistd::stof功能族。

二次

二次

继承图

成员函数

(constructor)

constructs the exception object (public member function)

性病::无效[医]论据::无效[医]论辩

explicit invalid_argument( const std::string& what_arg );

(1)

?

explicit invalid_argument( const char* what_arg );

(2)

(since C++11)

构造异常对象what_arg作为解释性字符串,可以通过what()...

因为复制std::exception不允许抛出异常,此消息通常作为单独分配的引用计数字符串存储在内部。这也是为什么没有构造函数std::string&&::无论如何,它必须复制内容。

参数

what_arg

-

explanatory string

例外

可抛std::bad_alloc...

继承自STD:例外

成员函数

(destructor) virtual

destructs the exception object (virtual public member function of std::exception)

what virtual

returns an explanatory string (virtual public member function of std::exception)

注记

此异常类型的用途类似于错误条件。std::errc::invalid_argument%28std::system_error的成员职能std::thread%29及相关的errno常数EINVAL...

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

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com