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 // Adaptation to Boost of the libcxx
10 // Copyright 2010 Vicente J. Botet Escriba
11 // Distributed under the Boost Software License, Version 1.0.
12 // See http://www.boost.org/LICENSE_1_0.txt
13
14 #define BOOST_RATIO_EXTENSIONS
15
16 #include <boost/ratio/mpl/less_equal.hpp>
17 #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
18 #define NOTHING ""
19 #endif
20
test()21 void test()
22 {
23 {
24 typedef boost::ratio<1, 1> R1;
25 typedef boost::ratio<1, 1> R2;
26 BOOST_RATIO_STATIC_ASSERT((boost::mpl::less_equal<R1, R2>::value), NOTHING, ());
27 }
28 {
29 typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R1;
30 typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R2;
31 BOOST_RATIO_STATIC_ASSERT((boost::mpl::less_equal<R1, R2>::value), NOTHING, ());
32 }
33 {
34 typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R1;
35 typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R2;
36 BOOST_RATIO_STATIC_ASSERT((boost::mpl::less_equal<R1, R2>::value), NOTHING, ());
37 }
38 {
39 typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R1;
40 typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R2;
41 BOOST_RATIO_STATIC_ASSERT((boost::mpl::less_equal<R1, R2>::value), NOTHING, ());
42 }
43 {
44 typedef boost::ratio<1, 1> R1;
45 typedef boost::ratio<1, -1> R2;
46 BOOST_RATIO_STATIC_ASSERT((!boost::mpl::less_equal<R1, R2>::value), NOTHING, ());
47 }
48 {
49 typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R1;
50 typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R2;
51 BOOST_RATIO_STATIC_ASSERT((!boost::mpl::less_equal<R1, R2>::value), NOTHING, ());
52 }
53 {
54 typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R1;
55 typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R2;
56 BOOST_RATIO_STATIC_ASSERT((boost::mpl::less_equal<R1, R2>::value), NOTHING, ());
57 }
58 {
59 typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R1;
60 typedef boost::ratio<1, -BOOST_RATIO_INTMAX_T_MAX> R2;
61 BOOST_RATIO_STATIC_ASSERT((!boost::mpl::less_equal<R1, R2>::value), NOTHING, ());
62 }
63 }
64