-----Original Message----- From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Bjorn Reese Sent: 06 February 2017 11:40 To: boost@lists.boost.org Subject: Re: [boost] Requirements: min and max macros
On 02/05/2017 06:15 PM, Vinnie Falco wrote:
From http://www.boost.org/development/requirements.html#Naming
"Make sure your code compiles in the presence of the min() and max() macros. Some platform headers define min() and max()macros which cause some common C++ constructs to fail to compile. Some simple tricks can protect your code from inappropriate macro substitution:..."
Is this guideline still relevant?
Yes - if only because the Boost checking tool
http://www.boost.org/doc/libs/1_63_0/tools/inspect/index.html
will complain if it is missing.
http://www.boost.org/development/requirements.html tells you what to do - search down for max or min.
"
Make sure your code compiles in the presence of the min() and max() macros. Some platform headers define min() and max() macros
which cause some common C++ constructs to fail to compile. Some simple tricks can protect your code from inappropriate macro
substitution:
If you want to call std::min() or std::max():
If you do not require argument-dependent look-up, use (std::min)(a,b).
If you do require argument-dependent look-up, you should:
#include