C++ Logo


Advanced search

Re: [std-proposals] Integer overflow arithmetic

From: Tiago Freire <tmiguelf_at_[hidden]>
Date: Sat, 17 Feb 2024 11:53:42 +0000

> [In the case where the signedness is left unchanged] by the cast, you can probably do:
> static_cast<From>(static_cast<To>(x)) == x
>This simply checks whether the roundtrip conversion preserves the value.
Sorry, I misread that.

Received on 2024-02-17 11:53:43