From bcf4ac887e3136c689d5e7e6da79ca01dc46a033 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 29 Oct 2013 17:16:09 +0000 Subject: [PATCH] Allow Boost.Math to be used without RTTI. Fixes #9317. [SVN r86517] --- include/boost/math/policies/error_handling.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/boost/math/policies/error_handling.hpp b/include/boost/math/policies/error_handling.hpp index 96333d342..e7dbb4020 100644 --- a/include/boost/math/policies/error_handling.hpp +++ b/include/boost/math/policies/error_handling.hpp @@ -87,7 +87,11 @@ void raise_error(const char* function, const char* message) message = "Cause unknown"; std::string msg("Error in function "); +#ifndef BOOST_NO_RTTI msg += (boost::format(function) % typeid(T).name()).str(); +#else + msg += function; +#endif msg += ": "; msg += message; @@ -104,7 +108,11 @@ void raise_error(const char* function, const char* message, const T& val) message = "Cause unknown: error caused by bad argument with value %1%"; std::string msg("Error in function "); +#ifndef BOOST_NO_RTTI msg += (boost::format(function) % typeid(T).name()).str(); +#else + msg += function; +#endif msg += ": "; msg += message;