Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 1.7 KB

ranges_not_equal_to.md

File metadata and controls

62 lines (46 loc) · 1.7 KB

not_equal_to

  • functional[meta header]
  • std::ranges[meta namespace]
  • class template[meta id-type]
  • cpp20[meta cpp]
namespace std::ranges {
  struct not_equal_to {
    template<class T, class U>
      requires equality_comparable_with<T, U>
    constexpr bool operator()(T&& t, U&& u) const;

    using is_transparent = unspecified;
  };
}
  • unspecified[italic]
  • equality_comparable_with[link /reference/concepts/equality_comparable.md]

概要

not_equal_toクラスは、非等値比較を行う関数オブジェクトである。

この関数オブジェクトは一切のメンバ変数を持たず、状態を保持しない。

テンプレートパラメータ制約

  • TU== および != で同値比較可能、もしくは declval<T>() == declval<U>() がポインタ同士を比較する組み込みの演算に帰着すること。

メンバ関数

名前 説明
operator () !ranges::equal_to{}(std::forward<T>(t), std::forward<U>(u)); と等価

メンバ型

名前 説明
is_transparent operator() が関数テンプレートである事を示すタグ型。
実装依存の型であるがあくまでタグ型であり、型そのものには意味はない。

#include <iostream>
#include <functional>

int main()
{
  std::cout << std::boolalpha << std::ranges::not_equal_to()(3, 3) << std::endl;
}
  • std::ranges::not_equal_to[color ff0000]

出力

false

参照