From 1d0880a9ef2f1db5ac7331bb4232db2ae55476f7 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 6 May 2017 13:16:31 +0100 Subject: [PATCH] Remove dependencies on format and type_index. --- .../detail/barycentric_rational_detail.hpp | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/include/boost/math/interpolators/detail/barycentric_rational_detail.hpp b/include/boost/math/interpolators/detail/barycentric_rational_detail.hpp index 63274b395..b853901d8 100644 --- a/include/boost/math/interpolators/detail/barycentric_rational_detail.hpp +++ b/include/boost/math/interpolators/detail/barycentric_rational_detail.hpp @@ -9,9 +9,9 @@ #define BOOST_MATH_INTERPOLATORS_BARYCENTRIC_RATIONAL_DETAIL_HPP #include -#include -#include +#include #include +#include namespace boost{ namespace math{ namespace detail{ @@ -59,14 +59,14 @@ barycentric_rational_imp::barycentric_rational_imp(InputIterator1 start_x, // But if we're going to do a memcpy, we can do some error checking which is inexpensive relative to the copy: if(boost::math::isnan(*start_x)) { - boost::format fmtr = boost::format("x[%1%] is a NAN") % i; - throw std::domain_error(fmtr.str()); + std::string msg = std::string("x[") + boost::lexical_cast(i) + "] is a NAN"; + throw std::domain_error(msg); } if(boost::math::isnan(*start_y)) { - boost::format fmtr = boost::format("y[%1%] is a NAN") % i; - throw std::domain_error(fmtr.str()); + std::string msg = std::string("y[") + boost::lexical_cast(i) + "] is a NAN"; + throw std::domain_error(msg); } m_x[i] = *start_x; @@ -97,8 +97,12 @@ barycentric_rational_imp::barycentric_rational_imp(InputIterator1 start_x, Real diff = m_x[k] - m_x[j]; if (abs(diff) < std::numeric_limits::epsilon()) { - boost::format fmtr = boost::format("Spacing between x[%1%] and x[%2%] is %3%, which is smaller than the epsilon of %4%") % k % i % diff % boost::typeindex::type_id().pretty_name(); - throw std::logic_error(fmtr.str()); + std::string msg = std::string("Spacing between x[") + + boost::lexical_cast(k) + std::string("] and x[") + + boost::lexical_cast(i) + std::string("] is ") + + boost::lexical_cast(diff) + std::string(", which is smaller than the epsilon of ") + + boost::core::demangle(typeid(Real).name()); + throw std::logic_error(msg); } inv_product *= diff; }