blob: 27695865705d1f44fa4c5f927ebc715b054e558d [file] [log] [blame]
[/
Copyright 2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:floating_point_promotion floating_point_promotion]
template <class T>
struct floating_point_promotion
{
typedef __below type;
};
template <class T> using floating_point_promotion_t = typename floating_point_promotion<T>::type; // C++11 and above
__type If floating point promotion can be applied to an rvalue of type `T`,
then applies floating point promotion to `T` and keeps cv-qualifiers of `T`,
otherwise leaves `T` unchanged.
__std_ref 4.6.
__header ` #include <boost/type_traits/floating_point_promotion.hpp>` or ` #include <boost/type_traits.hpp>`
[table Examples
[ [Expression] [Result Type]]
[[`floating_point_promotion<float const>::type`][`double const`]]
[[`floating_point_promotion<float&>::type`][`float&`]]
[[`floating_point_promotion<short>::type`][`short`]]
]
[all_compilers]
[endsect]