intptr_t is not a good choice for an arithmetic int type.
What if pointers are 64 bits and optimum arithmetic width is 32 bits?
E.g. GPUs.
Or even CPU code may be compiled for AVX/SSE/SVE/...
And there are a lot of standardized int alternatives now in <cstdint> - fast ones, small ones,
https://en.cppreference.com/cpp/types/integer
int_fast32_t could be a good type for those purposes.
-----Ursprüngliche Nachricht-----
Von: Frederick Virchanza Gotham via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Mo 07.09.2026 14:49
Betreff: [std-proposals] Deprecate int
An: std-proposals <std-proposals@lists.isocpp.org>;
CC: Frederick Virchanza Gotham <cauldwell.thomas@gmail.com>;
'int' is no longer fit for purpose as described in the Standard:
"Plain int's have the natural size suggested
by the architecture of the execution environment"
This isn't abided anymore, as all 64-Bit platforms have 32-Bit int's.
It is for this reason that in my code I use 'uintptr_t' when I need
the 'natural size' integer.
Just this week, I found old code of mine that used 'uintptr_t', and I
went looking for where in the code I converted a pointer to an int --
but I couldn't find it. Then I realised that I was only using that
type as the 'natural' type. So maybe we should have:
namespace std {
typedef intptr_t int_t;
typedef uintptr_t uint_t;
}
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals