]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/container_hash/test/check_float_funcs.cpp
2 // Copyright 2012 Daniel James.
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // in type_traits/is_complete.hpp:47
8 #pragma GCC diagnostic ignored "-Wconversion"
11 #include <boost/static_assert.hpp>
12 #include <boost/type_traits/is_same.hpp>
13 #include <boost/type_traits/is_convertible.hpp>
19 struct check_return_type
22 static void equals(T2
)
24 BOOST_STATIC_ASSERT((boost::is_same
<T1
, T2
>::value
));
28 static void equals_ref(T2
&)
30 BOOST_STATIC_ASSERT((boost::is_same
<T1
, T2
>::value
));
34 static void convertible(T2
)
36 BOOST_STATIC_ASSERT((boost::is_convertible
<T2
, T1
>::value
));
46 test::check_return_type
<float>::equals(std::ldexp(f
, 0));
47 test::check_return_type
<double>::equals(std::ldexp(d
, 0));
48 test::check_return_type
<long double>::equals(std::ldexp(l
, 0));
52 test::check_return_type
<float>::equals(std::frexp(f
, &dummy
));
53 test::check_return_type
<double>::equals(std::frexp(d
, &dummy
));
54 test::check_return_type
<long double>::equals(std::frexp(l
, &dummy
));
56 #if BOOST_HASH_USE_FPCLASSIFY
58 int (*fpc1
)(float) = std::fpclassify
;
59 int (*fpc2
)(double) = std::fpclassify
;
60 int (*fpc3
)(long double) = std::fpclassify
;