Boost logo

Boost :

From: Simon Buchan (simon_at_[hidden])
Date: 2005-09-29 04:20:40


Daryle Walker wrote:
> The "int" type was supposed to match the processor's natural built-in
> integer processor. That was easy to maintain in the 16- and 32-bit eras,
> but got screwed up when we started 64-bit computing. The C and C++
> communities decided to expand its integer types by keeping the current types
> at their 32-bit-era sizes and extended the type system with a "long long"
> instead of moving "int" and "long" up and adding a "short short". Now we
> don't have a convenient way to name the best integer type in a portable
> fashion. I suggest we add a "int_natural_t" typedef to <boost/cstdint.hpp>
> to name the best integer type (and a corresponding "uint_natural_t"). We
> would have to research what that type is for each compiler and/or platform
> combination and use #conditionals.
>
Isn't int the 'natural' integer type, by definition?
I never understood why long didn't become the 64-bit type. It seems
pointless to have int and long the same size on 32-bit. Who still
writes 16-bit code on desktop, anyway? :D


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk