Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83748 - trunk/boost/math/special_functions
From: john_at_[hidden]
Date: 2013-04-03 13:45:34


Author: johnmaddock
Date: 2013-04-03 13:45:33 EDT (Wed, 03 Apr 2013)
New Revision: 83748
URL: http://svn.boost.org/trac/boost/changeset/83748

Log:
Remove outdated workarounds and simply code.
Fixes #8333.
Text files modified:
   trunk/boost/math/special_functions/sinc.hpp | 52 +++++++--------------------------------
   1 files changed, 10 insertions(+), 42 deletions(-)

Modified: trunk/boost/math/special_functions/sinc.hpp
==============================================================================
--- trunk/boost/math/special_functions/sinc.hpp (original)
+++ trunk/boost/math/special_functions/sinc.hpp 2013-04-03 13:45:33 EDT (Wed, 03 Apr 2013)
@@ -36,36 +36,16 @@
     {
        namespace detail
        {
-#if defined(__GNUC__) && (__GNUC__ < 3)
- // gcc 2.x ignores function scope using declarations,
- // put them in the scope of the enclosing namespace instead:
-
- using ::std::abs;
- using ::std::sqrt;
- using ::std::sin;
-
- using ::std::numeric_limits;
-#endif /* defined(__GNUC__) && (__GNUC__ < 3) */
-
         // This is the "Sinus Cardinal" of index Pi.
 
         template<typename T>
         inline T sinc_pi_imp(const T x)
         {
-#if defined(BOOST_NO_STDC_NAMESPACE) && !defined(__SUNPRO_CC)
- using ::abs;
- using ::sin;
- using ::sqrt;
-#else /* BOOST_NO_STDC_NAMESPACE */
- using ::std::abs;
- using ::std::sin;
- using ::std::sqrt;
-#endif /* BOOST_NO_STDC_NAMESPACE */
-
- // Note: this code is *not* thread safe!
- static T const taylor_0_bound = tools::epsilon<T>();
- static T const taylor_2_bound = sqrt(taylor_0_bound);
- static T const taylor_n_bound = sqrt(taylor_2_bound);
+ BOOST_MATH_STD_USING
+
+ T const taylor_0_bound = tools::epsilon<T>();
+ T const taylor_2_bound = tools::root_epsilon<T>();
+ T const taylor_n_bound = tools::forth_root_epsilon<T>();
 
             if (abs(x) >= taylor_n_bound)
             {
@@ -110,28 +90,16 @@
           return detail::sinc_pi_imp(static_cast<result_type>(x));
        }
 
-#ifdef BOOST_NO_TEMPLATE_TEMPLATES
-#else /* BOOST_NO_TEMPLATE_TEMPLATES */
+#ifndef BOOST_NO_TEMPLATE_TEMPLATES
         template<typename T, template<typename> class U>
         inline U<T> sinc_pi(const U<T> x)
         {
-#if defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL) || defined(__GNUC__)
- using namespace std;
-#elif defined(BOOST_NO_STDC_NAMESPACE) && !defined(__SUNPRO_CC)
- using ::abs;
- using ::sin;
- using ::sqrt;
-#else /* BOOST_NO_STDC_NAMESPACE */
- using ::std::abs;
- using ::std::sin;
- using ::std::sqrt;
-#endif /* BOOST_NO_STDC_NAMESPACE */
-
+ BOOST_MATH_STD_USING
             using ::std::numeric_limits;
 
- static T const taylor_0_bound = tools::epsilon<T>();
- static T const taylor_2_bound = sqrt(taylor_0_bound);
- static T const taylor_n_bound = sqrt(taylor_2_bound);
+ T const taylor_0_bound = tools::epsilon<T>();
+ T const taylor_2_bound = tools::root_epsilon<T>();
+ T const taylor_n_bound = tools::forth_root_epsilon<T>();
 
             if (abs(x) >= taylor_n_bound)
             {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk