Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-08-21 18:51:41


"Dave Steffen" <dgsteffen_at_[hidden]> wrote in message
news:17642.14441.683655.649056_at_yttrium.numerica.us...
> 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.

What? By means of a Macro switch in the config header?

regards
Andy Little


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