class template
<ratio>
std::ratio_not_equal
template <class R1, class R2> ratio_not_equal;
Compare ratios for inequality
This type inherits from the appropriate integral_constant type (either true_type or false_type) to signal whether R1 compares not equal to R2
The resulting type is the same as if ratio_equal was defined as:
1 2
|
template <class R1, class R2>
struct ratio_equal : integral_constant < bool, !ratio_equal<R1,R2>::value > {};
|
Template parameters
- R1,R2
- ratio types to be compared.
Member constants
Inherited from integral_constant:
member constant | definition |
value | either true or false |
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
// ratio_not_equal example
#include <iostream>
#include <ratio>
int main ()
{
typedef std::ratio<1,2> one_half;
typedef std::ratio<2,4> two_fourths;
std::cout << "1/2 != 2/4 ? " << std::boolalpha;
std::cout << std::ratio_not_equal<one_half,two_fourths>::value << std::endl;
return 0;
}
|
Output:
See also
- ratio_equal
- Compare ratios (class template
)
- ratio_less
- Compare ratios for less-than inequality (class template
)
- ratio_add
- Add two ratios (class template
)