Deprecate implicit conversion between signed and unsigned integers
Kagamin
spam at here.lot
Thu Feb 6 16:48:27 UTC 2025
On Tuesday, 4 February 2025 at 16:29:22 UTC, Quirin Schroll wrote:
> Any implicit conversions? I’d boldly claim the following
> conversions are unproblematic:
> * `float` → `double` → `real`
> * signed integer → bigger signed integer
> * unsigned integer → bigger unsigned integer
I once ported a 32 bit C++ application to 64 bit. The code was
```
uint32_t found=str1.find(str2);
if(found==string::npos)return;
str3=str1.substr(0,found);
```
One can say the problem is in narrowing conversion, but there's
still the fundamental problem that `npos` of different widths are
incompatible.
More information about the dip.ideas
mailing list