T
Tomás Ó hÉilidhe
I posted an article of similar effect to this to comp.std.c++ but for some
reason it hasn't shown up in the newsgroup.
Anyway, instead of having a system in C++ whereby each integer type has a
minimum range (e.g. int must be at least 16-Bit), would it not be a hell of
a lot better if we could define objects as follows:
uint_fast24_t i;
, where 24 can be replaced with whatever range you need. I think it would
be trivial for a compiler to iterate thru all the integer types it provides
to pick the most appropriate one.
Or perhaps another method could be:
int {0,65535} i; /* 0 and 65535 specify the min and max */
(although personally I prefer the former way of doing it)
This would lead to portable algorithms that run faster.
reason it hasn't shown up in the newsgroup.
Anyway, instead of having a system in C++ whereby each integer type has a
minimum range (e.g. int must be at least 16-Bit), would it not be a hell of
a lot better if we could define objects as follows:
uint_fast24_t i;
, where 24 can be replaced with whatever range you need. I think it would
be trivial for a compiler to iterate thru all the integer types it provides
to pick the most appropriate one.
Or perhaps another method could be:
int {0,65535} i; /* 0 and 65535 specify the min and max */
(although personally I prefer the former way of doing it)
This would lead to portable algorithms that run faster.