1 | // Copyright 2005 Alexander Nasonov. |
2 | // Distributed under the Boost Software License, Version 1.0. (See |
3 | // accompanying file LICENSE_1_0.txt or copy at |
4 | // http://www.boost.org/LICENSE_1_0.txt) |
5 | |
6 | #ifndef FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED |
7 | #define FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED |
8 | |
9 | #include <boost/config.hpp> |
10 | |
11 | namespace boost { |
12 | |
13 | template<class T> struct floating_point_promotion { typedef T type; }; |
14 | template<> struct floating_point_promotion<float> { typedef double type; }; |
15 | template<> struct floating_point_promotion<float const> { typedef double const type; }; |
16 | template<> struct floating_point_promotion<float volatile>{ typedef double volatile type; }; |
17 | template<> struct floating_point_promotion<float const volatile> { typedef double const volatile type; }; |
18 | |
19 | #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) |
20 | |
21 | template <class T> using floating_point_promotion_t = typename floating_point_promotion<T>::type; |
22 | |
23 | #endif |
24 | |
25 | } |
26 | |
27 | #endif // #ifndef FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED |
28 | |
29 | |