最終更新日時(UTC):
が更新

履歴 編集

function
<typeindex>

std::type_index::operator!=(C++11)

// operator==により、以下の演算子が使用可能になる (C++20)
bool operator!=(const type_index& rhs) const noexcept; // (1) C++11

概要

非等値の判定を行う

戻り値

*target != *rhs.target

targetは、type_indexのメンバ変数として保持されているtype_infoオブジェクトへのポインタ(説明用)

例外

投げない

#include <cassert>
#include <typeindex>

int main()
{
  std::type_index t1 = typeid(int);
  std::type_index t2 = typeid(double);

  assert(t1 != t2);
  assert(t1 != typeid(double));
}

出力

バージョン

言語

  • C++11

処理系

参照