John wrote in
in comp.lang.c++:
Is there a way to change the internal representation from "unsigned"
to "unsigned long long".
No.
I use unsigned as its standard (and thus portable), "unsigned long long"
or __ulong_long or ULONGLONG or whatever its called on any given
implementation isn't.
Also I've seen implementations of "long long" (i.e. 64 bit types) that
simply don't work. They don't add up, at least not correctly
.
In fact this was part of the motivation for writing the library so
Also in my application each number has fixed number of bits. 128
So I dont really wanna store
enum uint_enum_t
{
NBits = N,
NWords = NWORDS_IMP_( N )
};
The enum is only used to do a compile time calculation, no instances are
ever created. If I had started writing this lib' with a modern compiler,
say g++ 3.4 or MSVC++ 7.1, I would have probaly static intergral
constants to do this, but the was a time when enum's were more portable.
for every number, can I make it static or better a global constant?
Enumaration values are compile time constants, and no it can't be global
as its dependant on a template paramiter, N above.
On a 32 bit machine (typical windows/x86 desktop) you should find:
sizeof( imp::unsigned_int< 128 > ) == 16.
I.e. it 4 * 4 byte (32 bit) unsigned's big.
Rob.