Boost logo

Boost :

From: Dave Harris (brangdon_at_[hidden])
Date: 2002-11-17 14:09:34


In-Reply-To: <memo.182934_at_[hidden]>
On Sun, 17 Nov 2002 16:28 +0000 (GMT) Dave Harris
(brangdon_at_[hidden]) wrote:
> And of course, we cannot use it as the default way of writing
> integers because for some numbers it is less efficient (with this
> scheme the overhead can never be more than a byte).

On second thoughts, the advantage of greater machine independence is
probably worth the cost of an occasional extra byte. So perhaps the
default loaders for short, int, long et al should all use a single
underlying variable length format, and other methods should be provided
for loading exactly 16-bit, 32-bit etc integers. These would be used by
people who care about the overhead, understand when it will be incurred,
and don't care about machine dependence. Fixed-length formats are a
low-level optimisation.

If this approach is taken, there isn't any need to add save_vri() etc to
the base class. However, types such as version_type still need to be
chosen with the availability of variable length formats in mind. There's
no need to restrict them artificially.

-- Dave Harris


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