forked from boostorg/conversion
GCC 2.95.2 bug workaround courtesy Jens Maurer
[SVN r8346]
This commit is contained in:
@@ -140,15 +140,30 @@ namespace boost
|
|||||||
struct limits : std::numeric_limits<T>
|
struct limits : std::numeric_limits<T>
|
||||||
{
|
{
|
||||||
static inline T min()
|
static inline T min()
|
||||||
|
# ifndef __GNUC__ // bug workaround courtesy Jens Maurer
|
||||||
{
|
{
|
||||||
return std::numeric_limits<T>::min() >= 0
|
return std::numeric_limits<T>::min() >= 0
|
||||||
// unary minus causes integral promotion, thus the static_cast<>
|
// unary minus causes integral promotion, thus the static_cast<>
|
||||||
? static_cast<T>(-std::numeric_limits<T>::max())
|
? static_cast<T>(-std::numeric_limits<T>::max())
|
||||||
: std::numeric_limits<T>::min();
|
: std::numeric_limits<T>::min();
|
||||||
}
|
}
|
||||||
|
# else
|
||||||
|
;
|
||||||
|
# endif
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# ifdef __GNUC__ // bug workaround courtesy Jens Maurer
|
||||||
|
template<> template<class T>
|
||||||
|
inline T numeric_min_select<true>::limits<T>::min()
|
||||||
|
{
|
||||||
|
return std::numeric_limits<T>::min() >= 0
|
||||||
|
// unary minus causes integral promotion, thus the static_cast<>
|
||||||
|
? static_cast<T>(-std::numeric_limits<T>::max())
|
||||||
|
: std::numeric_limits<T>::min();
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct numeric_min_select<false>
|
struct numeric_min_select<false>
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user