date icon indicating copy to clipboard operation
date copied to clipboard

Compiler error on windows around use of min

Open maztheman opened this issue 4 years ago • 1 comments

Simple fix is the wrap the word min and max in () such as:

static CONSTCD11 year (min)() NOEXCEPT { return year{-32767}; }
static CONSTCD11 year (max)() NOEXCEPT { return year{32767}; }

Taking from fmtlib's handling of min and max this is the easiest way to fix this issue.

maztheman avatar Sep 04 '20 16:09 maztheman

Another good fix is to compile with NOMINMAX defined.

HowardHinnant avatar Sep 04 '20 17:09 HowardHinnant