最終更新日時:
が更新

履歴 編集

function template
<utility>

std::constant_wrapper::operator!(C++26)

template <constexpr-param T>
friend constexpr auto operator!(T x) noexcept;

概要

constant_wrapperが保持する値の論理否定をとる。

戻り値

constant_wrapper<(!T::value)>{}を返す。

備考

  • Hidden friendsとして定義されるため、引数依存の名前探索 (ADL) でのみ発見される。
  • オペランドのいずれかがconstant_wrapperでない場合、保持する値へアンラップして通常の演算がおこなわれる。

#include <utility>

int main()
{
  // 比較結果を保持するconstant_wrapperを返す
  static_assert(!std::cw<false>);
}

出力


バージョン

言語

  • C++26

処理系

関連項目

参照