Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2001-10-26 18:36:35


----- Original Message -----
From: Darin Adler <darin_at_[hidden]>
To: Boost <boost_at_[hidden]>
Sent: Friday, October 26, 2001 8:27 PM
Subject: Re: [boost] casts, exceptions, and asserts

> on 10/26/01 4:20 PM, Fernando Cacciola at fcacciola_at_[hidden] wrote:
>
> > If I interpreted you correctly now, this is already supported.
> >
> > numeric_cast_traits<S,T>::subranged is true if the conversion could
loose
> > precision.
> > you can wrap that in a static_cast<>
>
> I'm talking about implementing that operation in cast.hpp. I understand
that
> your conversion traits is the tool for implementing it. But I was thinking
> of giving it a name.
>
>
Ah, I see.
Something like: exact_numeric_cast<T>(s), perhaps. It would fail to compile
if the conversion is subranged.
Yes, very useful for generic programming.

Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com


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