Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 1999-08-17 13:46:02


At 06:03 PM 8/17/99 +0200, Valentin Bonnard wrote:

>1/
>namespace boost
>{
>#include <boost/stdint.h>
>
>Hum hum

I assume "hum hum" means you think the usage is a bit odd. And it
is, but since the only thing in stdint.h are typedefs, we can hijack
them into namespace boost if we want to, AFAIK.

>2/
>Header: to be decided
>Contents: boost::integer_traits
>
>The natural name for a header which contains
>integer_traits is integer_traits.hpp

Agreed, and I almost put that in the draft. But I would like to
avoid too many small headers, so it might be better to combine with
the chooser templates, and then the header might better be called
integer.hpp or something similar.

>3/
>The default ctors of the classes in bin_ubin.hpp
>all fail to initialise the value.

Yes, and that is a very conscious design decision. These classes are
very low-level. So like built-in types, they don't default
initialize the value. Same rationale as for the built-in types.
Efficiency does count here. These things often appear in structs of
which huge buffer arrays for I/O are constructed, and we don't want
those initialized.

Remember that bin/ubin are used almost exclusively for trafficking
with the outside world via some I/O mechanism.

Now if lots of people complain, the initialization polity could
change. So people who think these classes should default initialize
should speak up! Otherwise they will stay the way they are.

Thanks for bring this up; it is the kind of design decision that
needs to be widely exposed to the light of day. In general it is
certainly better to default initialize.

--Beman


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