mirror of
https://github.com/boostorg/algorithm.git
synced 2025-07-06 09:16:33 +02:00
remove std_min and std_max, update minmax coding guidelines
[SVN r23162]
This commit is contained in:
@ -15,38 +15,10 @@
|
|||||||
#include <algorithm> // for std::min and std::max
|
#include <algorithm> // for std::min and std::max
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
namespace boost
|
#define BOOST_USING_STD_MIN()\
|
||||||
{
|
using std::min
|
||||||
|
|
||||||
template< typename T >
|
#define BOOST_USING_STD_MAX()\
|
||||||
inline T const & std_min( T const & a, T const & b )
|
using std::max
|
||||||
{
|
|
||||||
using std::min;
|
|
||||||
|
|
||||||
return min BOOST_PREVENT_MACRO_SUBSTITUTION ( a, b );
|
|
||||||
}
|
|
||||||
|
|
||||||
template< typename T >
|
|
||||||
inline T const & std_max( T const & a, T const & b )
|
|
||||||
{
|
|
||||||
using std::max;
|
|
||||||
|
|
||||||
return max BOOST_PREVENT_MACRO_SUBSTITUTION ( a, b );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Overloads for unsigned long to work around a bug in the Borland headers
|
|
||||||
#ifdef __BORLANDC__
|
|
||||||
inline unsigned long const & std_min( unsigned long const & a, unsigned long const & b )
|
|
||||||
{
|
|
||||||
return a < b ? a : b;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline unsigned long const & std_max( unsigned long const & a, unsigned long const & b )
|
|
||||||
{
|
|
||||||
return a > b ? a : b;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // BOOST_MINMAX_HPP
|
#endif // BOOST_MINMAX_HPP
|
||||||
|
Reference in New Issue
Block a user