Boost logo

Boost :

From: Matthias Schabel (boost_at_[hidden])
Date: 2007-03-26 17:52:00


> Please take everything I say with a gigantic salt crystal, but I would
> want to forbid an expression like "inches * miles / furlongs". You
> might
> recall that I am one of the few who wants explicit unit casting.

I think one of the important things to note is that our
implementation allows
the user fine-grained control of unit conversion - the default is
explicit only,
but it is possible to specify that certain units are implicitly
convertible. For
example, if I write

quantity<SI::length> L1(1.5*inches*miles/furlongs);

This will compile and give a correct answer if and only if there is a
conversion
(implicit or explicit) for each of the length units on the right.

Matthias


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