inline T raise_overflow_error( const char* function, const char* message, const ::pdalboost::math::policies::overflow_error< ::pdalboost::math::policies::user_error>&) { return user_overflow_error(function, message, std::numeric_limits<T>::infinity()); }
inline T raise_overflow_error( const char* function, const char* message, const T& val, const ::boost::math::policies::overflow_error< ::boost::math::policies::user_error>&) { std::string m(message ? message : ""); std::string sval = prec_format(val); replace_all_in_string(m, "%1%", sval.c_str()); return user_overflow_error(function, m.c_str(), std::numeric_limits<T>::infinity()); }
inline T raise_overflow_error( const char* function, const char* message, const T& val, const ::geofeatures_boost::math::policies::overflow_error< ::geofeatures_boost::math::policies::user_error>&) { std::string fmsg("Error in function "); #ifndef BOOST_NO_RTTI fmsg += (geofeatures_boost::format(function) % geofeatures_boost::math::policies::detail::name_of<T>()).str(); #else fmsg += function; #endif int prec = 2 + (geofeatures_boost::math::policies::digits<T, geofeatures_boost::math::policies::policy<> >() * 30103UL) / 100000UL; std::string msg = do_format(geofeatures_boost::format(message), geofeatures_boost::io::group(std::setprecision(prec), val)); return user_overflow_error(fmsg.c_str(), msg.c_str(), std::numeric_limits<T>::infinity()); }