• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright Louis Dionne 2013-2017
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
4 
5 #include <boost/hana/assert.hpp>
6 #include <boost/hana/core/to.hpp>
7 #include <boost/hana/equal.hpp>
8 #include <boost/hana/ext/std/ratio.hpp>
9 
10 #include <laws/base.hpp>
11 #include <support/cnumeric.hpp>
12 
13 #include <ratio>
14 #include <utility>
15 namespace hana = boost::hana;
16 
17 
main()18 int main() {
19     // Conversion from a Constant to a std::ratio
20     {
21         BOOST_HANA_CONSTANT_CHECK(hana::equal(
22             hana::to<hana::ext::std::ratio_tag>(cnumeric<int, 0>),
23             std::ratio<0>{}
24         ));
25 
26         BOOST_HANA_CONSTANT_CHECK(hana::equal(
27             hana::to<hana::ext::std::ratio_tag>(cnumeric<int, 1>),
28             std::ratio<1>{}
29         ));
30 
31         BOOST_HANA_CONSTANT_CHECK(hana::equal(
32             hana::to<hana::ext::std::ratio_tag>(cnumeric<int, 3>),
33             std::ratio<3>{}
34         ));
35     }
36 }
37