Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85414 - trunk/boost/math/policies
From: pbristow_at_[hidden]
Date: 2013-08-21 06:49:41


Author: pbristow
Date: 2013-08-21 06:49:40 EDT (Wed, 21 Aug 2013)
New Revision: 85414
URL: http://svn.boost.org/trac/boost/changeset/85414

Log:
Added missing version of overflow error handling to include a val parameter.

Text files modified:
   trunk/boost/math/policies/error_handling.hpp | 23 +++++++++++++++++++++++
   1 files changed, 23 insertions(+), 0 deletions(-)

Modified: trunk/boost/math/policies/error_handling.hpp
==============================================================================
--- trunk/boost/math/policies/error_handling.hpp Tue Aug 20 16:39:33 2013 (r85413)
+++ trunk/boost/math/policies/error_handling.hpp 2013-08-21 06:49:40 EDT (Wed, 21 Aug 2013) (r85414)
@@ -202,6 +202,7 @@
    return user_pole_error(function, message, val);
 }
 
+
 template <class T>
 inline T raise_overflow_error(
            const char* function,
@@ -215,6 +216,18 @@
 
 template <class T>
 inline T raise_overflow_error(
+ const char* function,
+ const char* message,
+ const T& val,
+ const ::boost::math::policies::overflow_error< ::boost::math::policies::throw_on_error>&)
+{
+ raise_error<std::overflow_error, T>(function, message ? message : "numeric overflow", val);
+ // We should never get here:
+ return std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() : boost::math::tools::max_value<T>();
+}
+
+template <class T>
+inline T raise_overflow_error(
            const char* ,
            const char* ,
            const ::boost::math::policies::overflow_error< ::boost::math::policies::ignore_error>&)
@@ -245,6 +258,7 @@
    return user_overflow_error(function, message, std::numeric_limits<T>::infinity());
 }
 
+
 template <class T>
 inline T raise_underflow_error(
            const char* function,
@@ -516,6 +530,15 @@
 }
 
 template <class T, class Policy>
+inline T raise_overflow_error(const char* function, const char* message, const T& val, const Policy&)
+{
+ typedef typename Policy::overflow_error_type policy_type;
+ return detail::raise_overflow_error(
+ function, message ? message : "Overflow evaluating function at %1%",
+ val, policy_type());
+}
+
+template <class T, class Policy>
 inline T raise_underflow_error(const char* function, const char* message, const Policy&)
 {
    typedef typename Policy::underflow_error_type policy_type;


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