Boost logo

Boost :

From: Bjorn.Karlsson_at_[hidden]
Date: 2003-01-15 09:58:23


> From: Thorsten Ottosen [mailto:nesotto_at_[hidden]]
>
> Hi Boosters,
>
> I was wondering if it would be possible to implement a wrapper around
> built-in types to provide automatic detection of conversion
> problems:

[snip]

What would the advantage be over using boost::numeric_cast directly, and
thus explicitly? Using these wrappers, it wouldn't be obvious that there are
numeric_casts involved (implying possible failure [and therefore try/catch
blocks for bad_numeric_cast]). As I see it, automatic detection of
conversion problems wouldn't buy much unless it could also remedy the
problem. Doing it "manually", and acknowledging the potential problem by
using numeric_cast is (in addition to ensuring correct behavior)
self-documenting, a property that I think is rather important.

Bjorn


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