|
Boost : |
Subject: Re: [boost] [boost::endian] Summary of discussion #1
From: Terry Golubiewski (tjgolubi_at_[hidden])
Date: 2010-06-04 12:01:54
> I suggested compressed_endian_integer. See my reply in that other part of
> the thread for subsequent discussion of such names.
I think the "endian" parameter is of secondary importance and should be
removed from the name: compressed_integer, packed_int, etc.
The type should still have an endianness template paramenter, but it should
default to "native".
Of my implementation, all that ever actually gets used is int24_t and
uint24_t. They are implemented as typedefs of packed_int which is similar
to Beman's, something like this.
typedef packed_int<3, signed, native> int24_t;
typedef packed_int<3, unsigned, native> uint24_t;
I don't specify mine in terms of "bits", the "3" represents the number of
bytes (which I assume are octets).
The "signed" and "unsigned" types are strictly tags and have nothing to do
with the actual implementation (other than to indicate sign).
If boost::integer is going to be a namespace, then I suppose these belong
there.
terry
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk