From 4728acd652b3677f121246262e6f5af3b1063ca3 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Tue, 28 Nov 2000 05:04:54 +0000 Subject: [PATCH] GCC 2.95.2 bug workaround courtesy Jens Maurer [SVN r8346] --- include/boost/cast.hpp | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/include/boost/cast.hpp b/include/boost/cast.hpp index 30eab09..325c284 100644 --- a/include/boost/cast.hpp +++ b/include/boost/cast.hpp @@ -139,16 +139,31 @@ namespace boost template struct limits : std::numeric_limits { - static inline T min() - { - return std::numeric_limits::min() >= 0 - // unary minus causes integral promotion, thus the static_cast<> - ? static_cast(-std::numeric_limits::max()) - : std::numeric_limits::min(); - } - }; + static inline T min() +# ifndef __GNUC__ // bug workaround courtesy Jens Maurer + { + return std::numeric_limits::min() >= 0 + // unary minus causes integral promotion, thus the static_cast<> + ? static_cast(-std::numeric_limits::max()) + : std::numeric_limits::min(); + } +# else + ; +# endif + }; }; - + +# ifdef __GNUC__ // bug workaround courtesy Jens Maurer + template<> template + inline T numeric_min_select::limits::min() + { + return std::numeric_limits::min() >= 0 + // unary minus causes integral promotion, thus the static_cast<> + ? static_cast(-std::numeric_limits::max()) + : std::numeric_limits::min(); + } +# endif + template<> struct numeric_min_select {