If the ratio R1
is less than the ratio R2
, provides the member constant value equal true. Otherwise, value is false.
template< class R1, class R2 >
constexpr bool ratio_less_v = ratio_less<R1, R2>::value;
#include <iostream> #include <ratio> int main() { using x = std::ratio<69, 90>; using y = std::ratio<70, 90>; if constexpr (std::ratio_less_v<x, y>) std::cout << x::num << '/' << x::den << " < " << y::num << '/' << y::den << '\n'; }
Output:
[edit] See also compares tworatio
objects for greater than at compile-time
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4