std::ratio_greater_equal

Header: <ratio>

If the ratio R1 is greater than or equal to the ratio R2, provides the member constant value equal true. Otherwise, value is false.

# Declarations

template< class R1, class R2 >
struct ratio_greater_equal : std::integral_constant<bool, /* see below */> { };

(since C++11)

# Example

#include <ratio>
 
int main()
{
    static_assert(std::ratio_greater_equal<
        std::ratio<2, 3>,
        std::ratio<2, 3>>::value, "2/3 >= 2/3");
 
    // since C++17
    static_assert(std::ratio_greater_equal_v<
        std::ratio<999'998, 999'999>,
        std::ratio<999'997, 999'998>>);
}

# See also