Requirements: min and max macros
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:..." There is one case not addressed. What to do with this: std::minstd::size_t(a, b); ?
On 02/05/17 20:15, 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:..."
There is one case not addressed. What to do with this:
std::minstd::size_t(a, b);
?
min and max are function-like macros. The code above is not affected by those.
On 05.02.2017 18:15, Vinnie Falco wrote:
There is one case not addressed. What to do with this:
std::minstd::size_t(a, b);
? (std::min)(std::size_t(a), std::size_t(b))
?
participants (3)
-
Andrey Semashev
-
Jonathan Müller
-
Vinnie Falco