Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2003-01-09 19:01:11


On Thu, 09 Jan 2003 14:40:26 -0500, David Abrahams
<dave_at_[hidden]> wrote:

>> Do you mean that we have implementations that don't provide the
>> x_MANT_DIG macros? Otherwise the code is perfectly portable by
>> 18.2.1.2 of the standard.
>
>No, I mean that those specializations might not be portable to all
>compilers. Remember that this file is for broken implementations to
>begin with.

Odd. Because detail/limits.hpp itself uses similar specializations.
Anyhow, we can't know before trying :-) If you agree I'll boostify the
templates I've attached with the initial post, and add something (like
'digits' above) for floating points too. If that works I'll send
(without committing) a new detail/limits.hpp that makes use of them.
Whether we can then commit the new version of detail/limits.hpp
depends on whether we can use my new stuff in the boost release. I'm
willing to propose it for a "new library" or for integrating it with
Daryle's integer library, no problem. The important thing is that we
have clean, portable, maintainable code, which is an advantage for
everybody. For instance, wandering through the boost code this morning
I've found that several libraries either have their own solution, in
the detail namespace, to numeric_limits problems (e.g. cast.hpp) or
include numeric_traits.hpp which, in turn, duplicates much of the
code. I think this is the sort of proliferation we should avoid. All
these 'ad hoc' solutions could simply be removed in favor of the new
templates, with advantage of maintainability, source code size and
maybe compile speed too. I know there's reluctance to touch something
"that works", but I think at some point it becomes the best long term
solution. It's obvious that I don't want to force anyone either, so if
you all think I'm a madman, or a code purity obsessed, feel free to
tell me! :-)

Genny.


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