Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-12-07 14:21:28


----- Original Message -----
From: "Kevlin Henney" <kevlin_at_[hidden]>

> Yes, this seems good. The cast form could wrap around this, and make use
> of the conversion result to create a more meaningful exception. In the
> dim and distant past a version of numeric_cast did report more specific
> errors through different exceptions.

Very dim and distant (if at all). I don't remember any such thing.

> It would be nice to have a
> consistent scheme for this, and I think this is it.
>
> This suggests that perhaps we should either rebrand the cast library the
> conversions library, with cast-like functions simply being one of the
> offerings, or break out the numeric stuff into a separate header to let
> it grow a little.

I think the latter. A colleague of mine just got finished a substantial
STLport patch which eliminates compiler warnings. He wrote a number of
helper functions like absolute_value(), is_negative(), etc., which used the
value of numeric_limits<T>::is_signed to avoid such things as unary negation
of unsigned types and unsigned comparisons with 0. These sorts of things
probably ought to be in boost.

-Dave


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