Skip to content

Latest commit

 

History

History
56 lines (42 loc) · 1.37 KB

ratio_greater.md

File metadata and controls

56 lines (42 loc) · 1.37 KB

ratio_greater

  • ratio[meta header]
  • std[meta namespace]
  • class template[meta id-type]
  • cpp11[meta cpp]
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");
}
  • std::ratio_greater[color ff0000]
  • std::ratio[link ratio.md]

出力

バージョン

言語

  • C++11

処理系

参照