Path: csiph.com!news.mixmin.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: Visual C++ 2019 is having a hissy fit over these two lines of code Date: Wed, 19 Jul 2023 22:51:50 -0700 Organization: None to speak of Lines: 22 Message-ID: <877cqvruyx.fsf@nosuchdomain.example.com> References: MIME-Version: 1.0 Content-Type: text/plain Injection-Info: dont-email.me; posting-host="7cb07f2c0431ee5f8bb40869fb2e49a1"; logging-data="2720522"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18VvOUnY4MDvZsN86WaXpdf" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:tBU3GNbkvrJSdTDyoeSupABnJWs= sha1:SnwR06vky68Eqonq1dZdPp6ABnw= Xref: csiph.com comp.lang.c++:91156 Lynn McGuire writes: > On 7/19/2023 11:46 PM, Andrey Tarasevich wrote: >> On 07/19/23 7:48 PM, Lynn McGuire wrote: >>> You know, I should give the error code: >> Compiles perfectly fine in my VS2019. >> The first thought was that it was just another example of the >> well-known conflict with Windows' own min/max macros. But regardless >> of `NOMINMAX` state, this code compiled without any issues for me. > > Thanks ! > > I can fix the problem by replacing the > std::numeric_limits::max(); with UINT_MAX. But, that is a > cheat. Surely you mean SIZE_MAX, defined in . (It's common for int to be 32 bits and size_t 64 bits.) -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */