Boost logo

Boost :

From: boost (boost_at_[hidden])
Date: 2001-04-13 05:17:35


> >
> > meters m = meters (10) + meters (20); //ok
> >
> > feet f = feet (5) + feet (10); // ok
> >
> > meters (10) + feet (20); // oops, compile-time error
> Wouldn't it be more useful to define conversions between feet and meters?
And the result type should be ? Living in Europe I would always convert
to SI units. Maybe it would be better to use explicit conversion then, e.g.
meters( feet(20) )

Best wishes,

By the way, how should one handle the case of redinitions of units?
With most of the units we're quite safe for normal life,
but the defintion of the kilogramm is still based on the prototype
in Paris and it may happen in the future that the defintion will be
based on natural constants, like the meter is based on the definition of time
using vacuum light speed. This won't change any conversion between
feet and meter, but there might be a change in the last few digits of some

Boost list run by bdawes at, gregod at, cpdaniel at, john at