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

履歴 編集

class template
<ratio>

std::ratio_greater(C++11)

namespace std {
  template <class R1, class R2>
  struct ratio_greater;

  template <class R1, class R2>
  inline constexpr bool ratio_greater_v
    = ratio_greater<R1, R2>::value;     // C++17
}

概要

ratio_greaterは、2つのratioにおいて、左辺が右辺より大きいかを判定するクラステンプレートである。

効果

ratio_greaterは、ratio_less<R2, R1>::value == trueであればtrue_typeから派生し、そうでなければfalse_typeから派生する。

#include <ratio>

int main()
{
  using r1 = std::ratio<3, 5>;
  using r2 = std::ratio<2, 5>;

  static_assert(std::ratio_greater<r1, r2>::value == true, "r1 > r2");
}

出力

バージョン

言語

  • C++11

処理系

参照