Chris@16: // (C) Copyright John Maddock 2005. Chris@16: // Use, modification and distribution are subject to the Chris@16: // Boost Software License, Version 1.0. (See accompanying file Chris@16: // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_TR1_MATH_OVERLOADS_HPP_INCLUDED Chris@16: # define BOOST_TR1_MATH_OVERLOADS_HPP_INCLUDED Chris@16: # include Chris@16: Chris@16: # ifndef BOOST_NO_SFINAE Chris@16: # include Chris@16: # include Chris@16: # define BOOST_TR1_MATH_RETURN(RET) typename ::boost::enable_if< ::boost::is_convertible, RET >::type Chris@16: # else Chris@16: # define BOOST_TR1_MATH_RETURN(RET) RET Chris@16: # endif Chris@16: Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: Chris@16: namespace boost{ namespace tr1_detail{ Chris@16: Chris@16: template Chris@16: struct largest_real Chris@16: { Chris@16: typedef typename boost::mpl::if_< Chris@16: boost::is_same, Chris@16: long double, Chris@16: typename boost::mpl::if_< Chris@16: boost::is_same, Chris@16: long double, Chris@16: typename boost::mpl::if_< Chris@16: boost::is_same, Chris@16: double, Chris@16: typename boost::mpl::if_< Chris@16: boost::is_same, Chris@16: double, Chris@16: float Chris@16: >::type Chris@16: >::type Chris@16: >::type Chris@16: >::type type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct promote_to_real Chris@16: { Chris@16: typedef typename largest_real< Chris@16: typename boost::mpl::if_< boost::is_floating_point, T, double>::type, Chris@16: typename boost::mpl::if_< boost::is_floating_point, U, double>::type Chris@16: >::type type; Chris@16: }; Chris@16: Chris@16: } } Chris@16: Chris@16: #endif Chris@16: