Boost logo

Boost :

From: Matthias Schabel (boost_at_[hidden])
Date: 2006-09-06 14:20:34


>> That is, for some arbitrary value types X
>> and Y for which (warning pseudocode ahead)
>>
>> Z operator+(X x,Y y)
>>
>> is defined
>>
>> quantity<Z> operator+(quantity<X> x,quantity<Y> y)
>>
>> will work and behave as expected...
>
> I need this feature!

If you want to be at the bleeding edge, you can give it a try. I've
uploaded this code as Vault/Units/mcs_units_hetero_op.zip. I think it
should work on non-g++ compilers (but _without_ heterogenous operator
functionality), but no guarantees. Everything except power<N> and
root<N> seems to work for me. Try unit_example_6.cpp to get a feel
for it...

Cheers,

Matthias


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