C++ Logo


Advanced search

Re: [std-proposals] Integer overflow arithmetic

From: Jan Schultke <janschultke_at_[hidden]>
Date: Fri, 16 Feb 2024 10:17:16 +0100
> This is of course still true with a named struct with named members. Nothing stops you from getting the order wrong.

That's true, and I should have elaborated on that point; at least
tooling has a chance.

Compiler warnings are one possible solution. Another way to spot the
mistake is to mouse-hover over the name in an IDE to see which member
it corresponds to.

Even if you don't diagnose it, you can always jump to the definition
of the function return type within an IDE to see what the correct
order is. You wouldn't have to go on cppreference and investigate, or
reverse-engineer it from the implementation of the function.

Received on 2024-02-16 09:17:28