1 //===----------------------------------------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // UNSUPPORTED: c++98, c++03, c++11
11
12 // <experimental/ratio>
13
14 // template <class R1, class R2> constexpr bool ratio_greater_equal_v;
15
16 #include <experimental/ratio>
17 #include <type_traits>
18
19 namespace ex = std::experimental;
20
main()21 int main()
22 {
23 {
24 typedef std::ratio<1, 2> R1;
25 typedef std::ratio<1, 1> R2;
26 static_assert(
27 !ex::ratio_greater_equal_v<R1, R2>, ""
28 );
29 static_assert(
30 ex::ratio_greater_equal_v<R1, R2>
31 == std::ratio_greater_equal<R1, R2>::value, ""
32 );
33 static_assert(
34 std::is_same<
35 decltype(ex::ratio_greater_equal_v<R1, R2>), const bool>::value
36 , ""
37 );
38 }
39 {
40 typedef std::ratio<1, 1> R1;
41 typedef std::ratio<1, 1> R2;
42 static_assert(
43 ex::ratio_greater_equal_v<R1, R2>, ""
44 );
45 static_assert(
46 ex::ratio_greater_equal_v<R1, R2>
47 == std::ratio_greater_equal<R1, R2>::value, ""
48 );
49 }
50 {
51 typedef std::ratio<2, 1> R1;
52 typedef std::ratio<1, 1> R2;
53 static_assert(
54 ex::ratio_greater_equal_v<R1, R2>, ""
55 );
56 static_assert(
57 ex::ratio_greater_equal_v<R1, R2>
58 == std::ratio_greater_equal<R1, R2>::value, ""
59 );
60 }
61 }
62