Boost logo

Boost Users :

Subject: Re: [Boost-users] [Review] UUID library (mini-)review starts today, November 23rd
From: Andy Tompkins (atompkins_at_[hidden])
Date: 2008-12-09 11:56:36


On Sat, 6 Dec 2008 15:28:30 -0500, "Scott McMurray"
<me22.ca+boost_at_[hidden]> said:
> On Sat, Dec 6, 2008 at 15:18, Andy Tompkins
> <atompkins_at_[hidden]> wrote:
> > On Wed, 03 Dec 2008 22:05:39 -0300, "Agustín K-ballo Bergé"
> > <kaballo86_at_[hidden]> said:
> >>
> >> Andy Tompkins escribió:
> >> > It could easily be made static. It will _always_ return 16.
> >> >
> >> Even for architectures with chars bigger than 8 bits long? From a
> >> quick read of the library source code, and boost::integer
> >> documentation, it seems that the library would not compile there.
> >
> > Hmm, can anyone verify this? I will address this if it is a
> > problem.
> >
> > What are the guarantees of the size of a byte? Is a byte always
> > 8 bits?
> >
>
> By C++ definition, a byte is the size of a char, and contains at
> least 8 bits.
>
> My understanding is that posix sockets require CHAR_BIT == 8, so
> outside of DSP chips and other special hardware, that's almost always
> the case. Considering that UUIDs were originally designed for RPC --
> typically over sockets -- and that the v1 algorithm is defined using
> MAC addresses, it's probably a safe assumption.

Thank you. So I think the uuid library will require either that
CHAR_BIT == 8
or CHAR_BIT % 8 == 0. That is to say that the platform must have 8 bit
bytes.

Andy.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net