std::is_nothrow_invocable_r
Defined in header <type_traits> | | |
---|---|---|
template <class Fn, class... ArgTypes> struct is_invocable; | (1) | (since C++17) |
template <class R, class Fn, class... ArgTypes> struct is_invocable_r; | (2) | (since C++17) |
template <class Fn, class... ArgTypes> struct is_nothrow_invocable; | (3) | (since C++17) |
template <class R, class Fn, class... ArgTypes> struct is_nothrow_invocable_r; | (4) | (since C++17) |
1%29决定Fn
可以用参数调用ArgTypes...
.正式决定是否INVOKE(declval<Fn>(), declval<ArgTypes>()...)
如果将其视为未计算的操作数,则为格式良好的操作数,其中INVOKE
中定义的操作吗?Callable
...
2%29决定Fn
可以用参数调用ArgTypes...
产生可转换为R
.正式决定是否INVOKE<R>(declval<Fn>(), declval<ArgTypes>()...)
如果将其视为未计算的操作数,则为格式良好的操作数,其中INVOKE
中定义的操作吗?Callable
3%29决定Fn
是可以用参数调用的。ArgTypes...
%28与%281%29%29相同,并且已知此调用不会引发任何异常。
4%29决定Fn
可以用参数调用ArgTypes...
产生可转换为R
%28与%282%29%29相同,并且已知此调用不会引发任何异常。
Fn, R
和参数包中的所有类型。ArgTypes
每一个都是一个完整的类型,%28可能是cv-合格%29void
,或者一系列未知的界限。否则,行为就没有定义。
辅助变量模板
Defined in header <type_traits> | | |
---|---|---|
template <class Fn, class... ArgTypes> inline constexpr bool is_invocable_v = std::is_invocable<Fn, ArgTypes...>::value; | (1) | (since C++17) |
template <class R, class Fn, class... ArgTypes> inline constexpr bool is_invocable_r_v = std::is_invocable_r<R, Fn, ArgTypes...>::value; | (2) | (since C++17) |
template <class Fn, class... ArgTypes> inline constexpr bool is_nothrow_invocable_v = std::is_nothrow_invocable<Fn, ArgTypes...>::value; | (3) | (since C++17) |
template <class R, class Fn, class... ArgTypes> inline constexpr bool is_nothrow_invocable_r_v = std::is_nothrow_invocable_r<R, Fn, ArgTypes...>::value; | (4) | (since C++17) |
继承自STD:积分[医]常量
成员常数
value static | true if INVOKE<R>(declval<Fn>(), declval<ArgTypes>()...) is well formed when treated as an unevaluated operand , false otherwise (public static member constant) |
---|
成员函数
operator bool | converts the object to bool, returns value (public member function) |
---|---|
operator() (C++14) | returns value (public member function) |
成员类型
Type | Definition |
---|---|
value_type | bool |
type | std::integral_constant<bool, value> |
实例
另见
invoke (C++17) | invokes any Callable object with given arguments (function template) |
---|---|
result_ofinvoke_result (C++11)(deprecated in C++17)(C++17) | deduces the result type of invoking a callable object with a set of arguments (class template) |
declval (C++11) | obtains a reference to its argument for use in unevaluated context (function template) |
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com