diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-03-28 15:46:49 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-03-28 15:46:49 (GMT) |
commit | f53a1ef582494458301b97bf6e546be52d7ff7e8 (patch) | |
tree | 7571b5cbcbd8a8f1dd1c966c9045b6cb69f0e295 /3rdParty/Boost/src/boost/type_traits/floating_point_promotion.hpp | |
parent | 638345680d72ca6acaf123f2c8c1c391f696e371 (diff) | |
download | swift-f53a1ef582494458301b97bf6e546be52d7ff7e8.zip swift-f53a1ef582494458301b97bf6e546be52d7ff7e8.tar.bz2 |
Moving submodule contents back.
Diffstat (limited to '3rdParty/Boost/src/boost/type_traits/floating_point_promotion.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/type_traits/floating_point_promotion.hpp | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/type_traits/floating_point_promotion.hpp b/3rdParty/Boost/src/boost/type_traits/floating_point_promotion.hpp new file mode 100644 index 0000000..8b6ae3a --- /dev/null +++ b/3rdParty/Boost/src/boost/type_traits/floating_point_promotion.hpp @@ -0,0 +1,91 @@ +// Copyright 2005 Alexander Nasonov. +// 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) + +#ifndef FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED +#define FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED + +#include <boost/config.hpp> + +#ifdef BOOST_NO_CV_SPECIALIZATIONS +#include <boost/mpl/at.hpp> +#include <boost/mpl/int.hpp> +#include <boost/mpl/multiplies.hpp> +#include <boost/mpl/plus.hpp> +#include <boost/mpl/vector.hpp> +#include <boost/type_traits/is_same.hpp> +#endif + +// Should be the last #include +#include <boost/type_traits/detail/type_trait_def.hpp> + +namespace boost { + +namespace type_traits { namespace detail { + +#ifndef BOOST_NO_CV_SPECIALIZATIONS + +template<class T> +struct floating_point_promotion +{ + typedef T type; +}; + +template<> +struct floating_point_promotion<float> +{ + typedef double type; +}; + +template<> +struct floating_point_promotion<float const> +{ + typedef double const type; +}; + +template<> +struct floating_point_promotion<float volatile> +{ + typedef double volatile type; +}; + +template<> +struct floating_point_promotion<float const volatile> +{ + typedef double const volatile type; +}; + +#else + +template<class T> +struct floating_point_promotion + : mpl::at< + mpl::vector< T, double, double const, double volatile, + double const volatile > + , mpl::plus< + is_same<T, float> + , mpl::multiplies< is_same<T, float const> , mpl::int_<2> > + , mpl::multiplies< is_same<T, float volatile> , mpl::int_<3> > + , mpl::multiplies< is_same<T, float const volatile>, mpl::int_<4> > + > + > +{ +}; + +#endif + +} } + +BOOST_TT_AUX_TYPE_TRAIT_DEF1( + floating_point_promotion + , T + , BOOST_DEDUCED_TYPENAME + boost::type_traits::detail::floating_point_promotion<T>::type + ) +} + +#include <boost/type_traits/detail/type_trait_undef.hpp> + +#endif // #ifndef FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED + |