From cbf8fd9cc9523901616de74f4252a49c3241190b Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 1 Jul 2013 18:14:14 +0000 Subject: [PATCH] Correct output of small-integer types. Fixes #8745. [SVN r84928] --- include/boost/multiprecision/cpp_int.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/multiprecision/cpp_int.hpp b/include/boost/multiprecision/cpp_int.hpp index 54536a49..1475c7b8 100644 --- a/include/boost/multiprecision/cpp_int.hpp +++ b/include/boost/multiprecision/cpp_int.hpp @@ -1427,11 +1427,12 @@ public: private: std::string do_get_trivial_string(std::ios_base::fmtflags f, const mpl::false_&)const { + typedef typename mpl::if_climbs()) == 1, unsigned, typename base_type::local_limb_type>::type io_type; if(this->sign() && (((f & std::ios_base::hex) == std::ios_base::hex) || ((f & std::ios_base::oct) == std::ios_base::oct))) BOOST_THROW_EXCEPTION(std::runtime_error("Base 8 or 16 printing of negative numbers is not supported.")); std::stringstream ss; ss.flags(f & ~std::ios_base::showpos); - ss << *this->limbs(); + ss << static_cast(*this->limbs()); std::string result; if(this->sign()) result += '-';