]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/type_traits/test/floating_point_promotion_test.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / type_traits / test / floating_point_promotion_test.cpp
CommitLineData
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
16TT_TEST_BEGIN(floating_point_promotion)
17
18BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<void>::type, void>::value), true);
19BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<void const>::type, void const>::value), true);
20BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<void volatile>::type, void volatile>::value), true);
21BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<void const volatile>::type, void const volatile>::value), true);
22
23BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<float>::type, double>::value), true);
24BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<float const>::type, double const>::value), true);
25BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<float volatile>::type, double volatile>::value), true);
26BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<float const volatile>::type, double const volatile>::value), true);
27
28BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<double>::type, double>::value), true);
29BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<double const>::type, double const>::value), true);
30BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<double volatile>::type, double volatile>::value), true);
31BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<double const volatile>::type, double const volatile>::value), true);
32
33BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<float&>::type, float&>::value), true);
34BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<float const&>::type, float const&>::value), true);
35BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<float volatile&>::type, float volatile&>::value), true);
36BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::floating_point_promotion<float const volatile&>::type, float const volatile&>::value), true);
37
38TT_TEST_END