(std::min)(x, y) #1271
(std::min)(x, y)
#1271
-
I notice that often Abseil calls capacity = (std::min)(capacity, kCustomLimit); Why? |
Beta Was this translation helpful? Give feedback.
Answered by
derekmauro
Sep 5, 2022
Replies: 1 comment 1 reply
-
We use |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
matta
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We use
(std::min)(a, b)
in headers because Windows has macros namedmin
andmax
. Our own build rules have/DNOMINMAX
, but we can't guarantee that everyone#include
-ing our headers also has/DNOMINMAX
. Somehow the parenthesis is a workaround, although I don't know what parsing rule makes it work.https://godbolt.org/z/M8Grc6xab