Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2003-01-16 09:06:26


<Bjorn.Karlsson_at_[hidden]> wrote in message
news:3D8559AE95B4D611B02C0002557C6C8B3C45C1_at_STH-EXCH...
[snip]
> > I might also be beneficial when you are chaning a variable
> > from one type to
> > another; the change
> > might cause conversion problems some different place in the
> > code and/or
> > require numeric_cast
> > to be inserted. By using wrappers this would be detected.
>
> True, but the price of this detection is using wrappers everywhere, which
> defeats the purpose, IMO; how should a maintainer know which parts of the
> code contains potential conversion issues when *all* of the code is
implying
> that is the case?

I could also imagine a syntax like this:

Double d = ...;
...
Int i = d.to<Int>();

That way you can explicitly see where you're requesting narrowing
conversion.

regards

Thorsten


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