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 {