microsoft / GSL

Guidelines Support Library
Other
6.13k stars 737 forks source link

Fix `max` macro collision #1081

Closed dmitrykobets-msft closed 1 year ago

dmitrykobets-msft commented 1 year ago

PR https://github.com/microsoft/GSL/pull/1076 introduced a usage of numeric_limits::max() function, which seems to have issues interacting with some Windows headers. This PR implements a simple fix, which is to wrap the invocations in parentheses. This offloads the fix from the users of the library.

beinhaerter commented 1 year ago

Thanks for fixing!