Boost logo

Boost :

From: Dave Steffen (dgsteffen_at_[hidden])
Date: 2006-08-21 18:49:13


Eric Lemings writes:
[...]
> > >>> 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. :-)

 Comment from the back row: Some people will want automatic
 conversions. Some people will want a compilation failure. Both are
 perfectly reasonable behaviors, and which one is appropriate is
 project specific.

 If (either) units library fails to provide both capabilities, it will
 be unusable for some category of projects.

 I don't know how to control this, nor what the interface should look
 like, but I am certain that a good units library will be able to go
 both ways.

----------------------------------------------------------------------
Dave Steffen, Ph.D.
Software Engineer IV Disobey this command!
Numerica Corporation - Douglas Hofstadter
dgsteffen at numerica dot us


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