Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-08-20 14:36:42


"Matthias Troyer" <troyer_at_[hidden]> wrote

> OK, this sounds reasonable enough, except that I'm still confused
> what exactly an anonymous quantity is.

I realise I didnt answer this question.

In the calculation:

force * distance;

The programmer might be dealing with a force acting at a moment, or the energy
required to move an object.
There is no way to tell from the calculation which. (One could apply some
angular tag to torque, but after experimenting with this I found it rather vague
and fussy).

Therefore, as there is no way to tell which quantity is intended I don't try, so
the result is an anonymous quantity.

One could apply various rules (for instance length * length --> area), but as I
can't apply a rule easily to the above case, I opted to apply the same rule to
every case of dimensionful multiplication and division, which was to return an
anonymous quantity and leave it to the programmer to decide which quantity they
were dealing with.

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