Liste des Groupes | Revenir à cl c++ |
On Thu, 12 Sep 2024 07:34:23 -0700You are still not getting it. The point is that 255 is _not_ necessarily the max value of `std::uint_fast8_t`, in which case incrementing past 255 is _not_ "incrementing beyond their max value". Template parameter of `std::counting_semaphore` is like that as well.
Andrey Tarasevich <andreytarasevich@hotmail.com> boringly babbled:On 09/12/24 4:00 AM, Muttley@dastardlyhq.com wrote:Incrementing integrals beyond their max value can have valid uses. A method>>
Clang seems to ignore it. You can call release() as much as you like and
it'll just keep increasing the counter.
>
It "ignores" it exactly the same way as the following declaration
>
std::uint_fast8_t n = 2;
>
might "ignore" the 8 in the type name and allow you to increment the
variable well past 255. Come to think of it, the underlying reasons for
allowing you to increment a counter beyond the apparent max counter value -
not so much.
Les messages affichés proviennent d'usenet.