std::min expected an identifierC/C++(40)
Closed this issue · 4 comments
copilot0058 commented
Describe the bug
A clear and concise description of what the bug is.
const size_t pos = std::min(url.find('?'), url.find('#'));
To Reproduce
expected an identifierC/C++(40)
#define min(a,b) (((a) < (b)) ? (a) : (b))
Expands to:
(((url.find('?')) < (url.find('#'))) ? (url.find('?')) : (url.find('#')))
magreenblatt commented
What OS, CEF version and compiler version?
vitaltree3 commented
Describe the bug A clear and concise description of what the bug is.
const size_t pos = std::min(url.find('?'), url.find('#'));
To Reproduce
expected an identifierC/C++(40) #define min(a,b) (((a) < (b)) ? (a) : (b)) Expands to: (((url.find('?')) < (url.find('#'))) ? (url.find('?')) : (url.find('#')))
Add "NOMINMAX" to PreprocessorDefinitions in your project setting , then your compile error will disappear.
magreenblatt commented
NOMINMAX
is also already defined in the provided CMake Windows configuration.
copilot0058 commented
Great