This documentation is archived and is not being maintained.

MIN/MAX #define Change

Visual Studio .NET 2003

The Standard C++ Library definition of _MIN and _MAX changed from:

#define _MAX   _cpp_max
#define _MIN   _cpp_min

to:

#define _MAX   (max)
#define _MIN   (min)

This makes definitions of std::_MIN invalid.

The following sample compiled in Visual C++ 6.0, but fails on the indicated line in the current version:

#include <xutility>
#include <stdlib.h>
using namespace std;
int main()
{
   std::_MAX(3,4);   // error
   _MAX(4,5);
}

See Also

Breaking Changes in the Standard C++ Library

Show: