|
Boost : |
From: Thomas Plum (tplum_at_[hidden])
Date: 1999-08-05 11:03:33
I want to provide some arguments for making use of, and encouraging
the use of, the <stdint.h> as defined in C9X (or indirectly thru a
boost-specific <stdint.hpp> or whatever).
First is a process issue. As liaison from WG21, I communicated to
WG14 that C++ was very unhappy with the original structure of
<stdint.h> in which typedefs and macros were all swizzled together.
The liaison from C++ was to subdivide the header, so that C++ can
use the typedefs without the macros. It took some convincing, but
this particular liaison request did pass. I think it's bad manners
to then decide to dump the result without a very strong functional
reason.
However, that argument might persuade no one but me, so I have
others. There is a maintenance cost, and a political cost, to each
feature of a standard or of an API. The <stdint.h> header was one
of the few features of C9X that was already in widespread use at
many sites, and it was also being widely used in the C++ implementations
at those sites. If boost, or C++ at large, defines some alternative
to <stdint.h>, then those two alternatives compete for maintenance
and political support.
If we were talking about important functional differences, then I
would think differently about that competition. But we are talking
about the same functionality ... defining exact/least/fast/etc types
for a specific set of integer bit widths. Whether the name of the
type is spelled int_exact<32>::type or int32_t or whatever, there
must be a one-line typedef somewhere in some header that defines that
type. Well, actually if everyone uses <stdint.h> (or indirectly via
<cstdint> ), there exists only one such typedef per type to be maintained,
but if C and C++ have different headers then there exist two such
typedefs for each type.
Just a plea to focus the creative effort upon the other problems, where
there is clearly no opportunity for common C/C++ solutions ...
>Reply-To: boost_at_[hidden]
>Delivered-To: listsaver-egroups-boost_at_[hidden]
>X-Lotus-FromDomain: QATRAIN
>From: "Kevlin Henney" <Kevlin.Henney_at_[hidden]>
>To: boost_at_[hidden]
>Date: Wed, 4 Aug 1999 07:21:19 +0100
>Subject: [boost] Re: Stdint header?
>
>Beman Dawes wrote:
>>Kevlin, what did your template approach look like?
>>
>> int_exact<32>::type
>> int_least<32>::type
>
>That strikes me as better than having a single type with
>exact/least/fast/etc types embedded. Not sure exactly why, but my
>gut feeling is it would extend better.
>
> Yes, gut feelings count for a lot on this one. These are effectively
> inverse traits, in the sense that a trait is being used to look up a
> type (rather than the other way around, as for traits) and so naming the
> inverse trait directly as the template name separately seemed a more
> reasonable approach.
>
> I also felt this was more extensible and more fine grained than offering
> the user a basket of types, especially as the mechanisms employed for
> each looked up type are quite different: simple specialisation vs a
> 'looping' search.
>
> Kevlin
>
>
>
>------------------------------------------------------------------------
>GET WHAT YOU DESERVE! A NextCard Platinum VISA: DOUBLE Rewards points,
>NO annual fee & rates as low as 9.9% FIXED APR. Apply online today!
>http://clickhere.egroups.com/click/606
>
>
>eGroups.com home: http://www.egroups.com/group/boost
>http://www.egroups.com - Simplifying group communications
>
-----------------------------------------------------------------------+
Thomas Plum Plum Hall Inc, 3 Waihona Box 44610, Kamuela HI 96743 USA
tplum_at_[hidden] TEL +1-808-882-1255 FAX +1-808-882-1556
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk