Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-08-21 17:55:28

"Deane Yang" <deane_yang_at_[hidden]> wrote in message
> Eric Lemings wrote:
>>> 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.

Personally I love implicit unit conversions. :-)
I can add a function to prevent them, but you will have to apply that

T b = no_cast(a);

or some such.

How's that?

Andy Little

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