Namespaces
Variants

std::experimental:: negation

From cppreference.net
ヘッダーで定義 <experimental/type_traits>
template < class B >
struct negation ;
(1) (library fundamentals TS v2)

型特性 B の論理否定を形成します。

negation < B > は、 UnaryTypeTrait であり、基本特性は std:: integral_constant < bool , ! bool ( B :: value ) > です。

目次

翻訳の説明: - 「Contents」を「目次」に翻訳しました - C++固有の用語(Template parameters、Helper variable template、std::integral_constant、Member constants、Member functions、Member types、Possible implementation、Example、See also)は原文のまま保持しました - HTMLタグ、属性、 内のテキストはすべて保持しました - 数値や記号は変更していません - フォーマットと構造は完全に保持されています

テンプレートパラメータ

B - bool ( B :: value ) が有効な定数式となる任意の型

ヘルパー変数テンプレート

template < class B >
constexpr bool negation_v = negation < B > :: value ;
(ライブラリファンダメンタルTS v2)

std:: integral_constant から継承

メンバ定数

value
[static]
true B がメンバ ::value を持ち、 ! bool ( B :: value ) true の場合)、 false (それ以外の場合)
(public static member constant)

メンバ関数

operator bool
オブジェクトを bool に変換し、 value を返す
(public member function)
operator()
(C++14)
value を返す
(public member function)

メンバ型

定義
value_type bool
type std:: integral_constant < bool , value >

実装例

template<class B>
struct negation : std::integral_constant<bool, !bool(B::value)> {};

関連項目

(C++17)
論理NOTメタ関数
(クラステンプレート)