15cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert//===----------------------------------------------------------------------===//
25cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert//
35cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert//                     The LLVM Compiler Infrastructure
45cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert//
55cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert// This file is dual licensed under the MIT and the University of Illinois Open
65cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert// Source Licenses. See LICENSE.TXT for details.
75cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert//
85cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert//===----------------------------------------------------------------------===//
95cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert
105cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert// UNSUPPORTED: c++98, c++03, c++11
115cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert
125cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert// <experimental/ratio>
135cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert
145cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert// template <class R1, class R2> constexpr bool ratio_greater_equal_v;
155cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert
165cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert#include <experimental/ratio>
175cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert#include <type_traits>
185cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert
195cb52824fc2a0caf233311e91d9a2a53368f04adDan Albertnamespace ex = std::experimental;
205cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert
215cb52824fc2a0caf233311e91d9a2a53368f04adDan Albertint main()
225cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert{
235cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert    {
245cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert        typedef std::ratio<1, 2> R1;
255cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert        typedef std::ratio<1, 1> R2;
265cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert        static_assert(
275cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert            !ex::ratio_greater_equal_v<R1, R2>, ""
285cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert          );
295cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert        static_assert(
305cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert            ex::ratio_greater_equal_v<R1, R2>
315cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert            == std::ratio_greater_equal<R1, R2>::value, ""
325cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert          );
335cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert        static_assert(
345cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert            std::is_same<
355cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert              decltype(ex::ratio_greater_equal_v<R1, R2>), const bool>::value
365cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert          , ""
375cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert          );
385cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert    }
395cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert    {
405cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert        typedef std::ratio<1, 1> R1;
415cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert        typedef std::ratio<1, 1> R2;
425cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert        static_assert(
435cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert            ex::ratio_greater_equal_v<R1, R2>, ""
445cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert          );
455cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert        static_assert(
465cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert            ex::ratio_greater_equal_v<R1, R2>
475cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert            == std::ratio_greater_equal<R1, R2>::value, ""
485cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert          );
495cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert    }
505cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert    {
515cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert        typedef std::ratio<2, 1> R1;
525cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert        typedef std::ratio<1, 1> R2;
535cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert        static_assert(
545cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert            ex::ratio_greater_equal_v<R1, R2>, ""
555cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert          );
565cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert        static_assert(
575cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert            ex::ratio_greater_equal_v<R1, R2>
585cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert            == std::ratio_greater_equal<R1, R2>::value, ""
595cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert          );
605cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert    }
615cb52824fc2a0caf233311e91d9a2a53368f04adDan Albert}
62