forked from boostorg/config
Moved min/max overloads to win32.hpp from suffix.hpp
[SVN r14551]
This commit is contained in:
@@ -50,3 +50,29 @@
|
|||||||
#ifndef NOMINMAX
|
#ifndef NOMINMAX
|
||||||
# define NOMINMAX
|
# define NOMINMAX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
namespace std{
|
||||||
|
// Apparently, something in the Microsoft libraries requires the "long"
|
||||||
|
// overload, because it calls the min/max functions with arguments of
|
||||||
|
// slightly different type. (If this proves to be incorrect, this
|
||||||
|
// whole "BOOST_MSVC" section can be removed.)
|
||||||
|
inline long min(long __a, long __b) {
|
||||||
|
return __b < __a ? __b : __a;
|
||||||
|
}
|
||||||
|
inline long max(long __a, long __b) {
|
||||||
|
return __a < __b ? __b : __a;
|
||||||
|
}
|
||||||
|
// The "long double" overload is required, otherwise user code calling
|
||||||
|
// min/max for floating-point numbers will use the "long" overload.
|
||||||
|
// (SourceForge bug #495495)
|
||||||
|
inline long double min(long double __a, long double __b) {
|
||||||
|
return __b < __a ? __b : __a;
|
||||||
|
}
|
||||||
|
inline long double max(long double __a, long double __b) {
|
||||||
|
return __a < __b ? __b : __a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
using std::min;
|
||||||
|
using std::max;
|
||||||
|
# endif
|
||||||
|
@@ -251,27 +251,6 @@ namespace std {
|
|||||||
inline const _Tp& max(const _Tp& __a, const _Tp& __b) {
|
inline const _Tp& max(const _Tp& __a, const _Tp& __b) {
|
||||||
return __a < __b ? __b : __a;
|
return __a < __b ? __b : __a;
|
||||||
}
|
}
|
||||||
# ifdef BOOST_MSVC
|
|
||||||
// Apparently, something in the Microsoft libraries requires the "long"
|
|
||||||
// overload, because it calls the min/max functions with arguments of
|
|
||||||
// slightly different type. (If this proves to be incorrect, this
|
|
||||||
// whole "BOOST_MSVC" section can be removed.)
|
|
||||||
inline long min(long __a, long __b) {
|
|
||||||
return __b < __a ? __b : __a;
|
|
||||||
}
|
|
||||||
inline long max(long __a, long __b) {
|
|
||||||
return __a < __b ? __b : __a;
|
|
||||||
}
|
|
||||||
// The "long double" overload is required, otherwise user code calling
|
|
||||||
// min/max for floating-point numbers will use the "long" overload.
|
|
||||||
// (SourceForge bug #495495)
|
|
||||||
inline long double min(long double __a, long double __b) {
|
|
||||||
return __b < __a ? __b : __a;
|
|
||||||
}
|
|
||||||
inline long double max(long double __a, long double __b) {
|
|
||||||
return __a < __b ? __b : __a;
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# endif
|
# endif
|
||||||
|
Reference in New Issue
Block a user