From 6378e00d865b15ec34db90178e7f1913951e677b Mon Sep 17 00:00:00 2001 From: Alexander Nasonov Date: Wed, 6 Jun 2007 20:02:45 +0000 Subject: [PATCH] Apply patch posted in 'attempt to patch floating_point_promotion on borland' message and wait for regression test results. http://lists.boost.org/Archives/boost/2007/06/122727.php [SVN r37919] --- include/boost/type_traits.hpp | 2 -- .../type_traits/floating_point_promotion.hpp | 30 +++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/include/boost/type_traits.hpp b/include/boost/type_traits.hpp index 80c9954..afba2ea 100644 --- a/include/boost/type_traits.hpp +++ b/include/boost/type_traits.hpp @@ -70,13 +70,11 @@ #include "boost/type_traits/type_with_alignment.hpp" #include "boost/type_traits/function_traits.hpp" #include "boost/type_traits/aligned_storage.hpp" -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x564) #include "boost/type_traits/floating_point_promotion.hpp" #if !(defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238)) #include "boost/type_traits/integral_promotion.hpp" #include "boost/type_traits/promote.hpp" #endif -#endif // Borland #include "boost/type_traits/ice.hpp" diff --git a/include/boost/type_traits/floating_point_promotion.hpp b/include/boost/type_traits/floating_point_promotion.hpp index 23d8a7f..8b6ae3a 100644 --- a/include/boost/type_traits/floating_point_promotion.hpp +++ b/include/boost/type_traits/floating_point_promotion.hpp @@ -8,6 +8,15 @@ #include +#ifdef BOOST_NO_CV_SPECIALIZATIONS +#include +#include +#include +#include +#include +#include +#endif + // Should be the last #include #include @@ -15,6 +24,8 @@ namespace boost { namespace type_traits { namespace detail { +#ifndef BOOST_NO_CV_SPECIALIZATIONS + template struct floating_point_promotion { @@ -45,6 +56,25 @@ struct floating_point_promotion typedef double const volatile type; }; +#else + +template +struct floating_point_promotion + : mpl::at< + mpl::vector< T, double, double const, double volatile, + double const volatile > + , mpl::plus< + is_same + , mpl::multiplies< is_same , mpl::int_<2> > + , mpl::multiplies< is_same , mpl::int_<3> > + , mpl::multiplies< is_same, mpl::int_<4> > + > + > +{ +}; + +#endif + } } BOOST_TT_AUX_TYPE_TRAIT_DEF1(