std::experimental::negation
< cpp | experimental
在标头
<experimental/type_traits> 定义 |
||
template< class B >
struct negation; |
(1) | (库基础 TS v2) |
构成类型特征 B
的逻辑反。
类型 negation<B> 是具有基础特征 std::integral_constant<bool, !bool(B::value)> 的一元类型特征 (UnaryTypeTrait) 。
模板形参
B | - | 使得表达式 bool(B::value) 为有效常量表达式的类型 |
辅助变量模板
template< class B >
constexpr bool negation_v = negation<B>::value; |
(库基础 TS v2) | |
继承自 std::integral_constant
成员常量
value
[静态]
|
如果 B 具有成员 ::value 使得 !bool(B::value) 为 true那么是 true,否则是 false(公开静态成员常量) |
成员函数
operator bool
|
将对象转换到 bool,返回 value (公开成员函数) |
operator()
(C++14)
|
返回 value (公开成员函数) |
成员类型
类型 | 定义 |
value_type |
bool |
type |
std::integral_constant<bool, value> |
可能的实现
template<class B> struct negation : std::integral_constant<bool, !bool(B::value)> {}; |
示例
本节未完成 原因:暂无示例 |
参阅
(C++17)
|
逻辑非元函数 (类模板) |