Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 2000-11-16 16:00:23


At 03:23 PM 11/16/2000 -0500, David Abrahams wrote:

>My feeling has always been that a compact, machine-independent,
>variable-length number representation (e.g. high bit set indicates the
end
>of the number) was the way to go if you care about portability at all.

A variable-length representation is great, but not for many fixed length
record files. Furthermore, a primary use is with data created by others
over whom we have no control. So what you are talking about is useful, but
not for all applications.

> The
>length of an int/long/char/short/wchar_t/float/double... on any given
>machine is too variable to make this work otherwise.

Several of my clients have been moving portable binary integer between the
largest mainframes and tiny embedded systems and everything in between for
15 years now. It works, works well, and is very trouble free as long as
you keep it simple. The only practical limitation is the machine must be
able to do 8-bit byte I/O or multiples thereof.

--Beman


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