Boost logo

Boost :

From: Eric Lemings (lemings_at_[hidden])
Date: 2006-08-21 18:42:21


 

> -----Original Message-----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]] On Behalf Of Andy Little
> Sent: Monday, August 21, 2006 3:55 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] Boost Units library preview
>
>
> "Deane Yang" <deane_yang_at_[hidden]> wrote in message
> news:ecd87h$brg$1_at_sea.gmane.org...
> > Eric Lemings wrote:
> >>> This brings up a good question. Say you have two objects:
> >>>
> >>> meters m = 1;
> >>> feet f = 2;
> >>>
> >>> What is the type (or unit) of the following expression?
> >>>
> >> m + f;
> >>
> >
> > I apologize for repeating myself, but I want this to fail
> to compile.
> > I do not want implicit conversion of units. I believe I am not
> > completely alone in this view.

Could you provide your rationale for wanting expressions like
this to fail? Maybe there is something we've overlooked?

> Personally I love implicit unit conversions. :-)

I'm inclined to agree. As long as the dimensions are correct
and a.) the result type is the dimension of the unit, or b.) the
programmer specifies the desired units, I don't see a problem with
implicit conversions between quantities (measures, whatever) of
compatible dimensions and units.

Eric.


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