]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | |
2 | // (C) Copyright John Maddock 2010. | |
3 | // Use, modification and distribution are subject to the | |
4 | // Boost Software License, Version 1.0. (See accompanying file | |
5 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | ||
7 | #ifdef TEST_STD | |
8 | # include <type_traits> | |
9 | #else | |
10 | # include <boost/type_traits/floating_point_promotion.hpp> | |
11 | #endif | |
12 | #include <boost/type_traits/is_same.hpp> | |
13 | #include "test.hpp" | |
14 | #include "check_integral_constant.hpp" | |
15 | ||
16 | TT_TEST_BEGIN(floating_point_promotion) | |
17 | ||
18 | BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<void>::type, void>::value), true); | |
19 | BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<void const>::type, void const>::value), true); | |
20 | BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<void volatile>::type, void volatile>::value), true); | |
21 | BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<void const volatile>::type, void const volatile>::value), true); | |
22 | ||
23 | BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<float>::type, double>::value), true); | |
24 | BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<float const>::type, double const>::value), true); | |
25 | BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<float volatile>::type, double volatile>::value), true); | |
26 | BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<float const volatile>::type, double const volatile>::value), true); | |
27 | ||
28 | BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<double>::type, double>::value), true); | |
29 | BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<double const>::type, double const>::value), true); | |
30 | BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<double volatile>::type, double volatile>::value), true); | |
31 | BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<double const volatile>::type, double const volatile>::value), true); | |
32 | ||
33 | BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<float&>::type, float&>::value), true); | |
34 | BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<float const&>::type, float const&>::value), true); | |
35 | BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<float volatile&>::type, float volatile&>::value), true); | |
36 | BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<float const volatile&>::type, float const volatile&>::value), true); | |
37 | ||
38 | TT_TEST_END |