
AMDG Christopher Bruns wrote:
Kudos on the excellent implementation of the Boost.Units library. I am also very grateful for the extremely timely help I have got in the past from the principal authors Matthias Schabel and Steven Watanabe.
Is there any way to force implicit conversion of Angstrom quantities to nanometer quantities in assignment and method calls using Boost.Units? I would appreciate any suggestions on how to get the final three method calls in the attached program to compile.
It can be done, but I don't advise it.
I suppose I could overload the showBondLength() method in this example to take both types. I think I would prefer implicit conversion, if that is possible.
In this particular case, I would suggest writing the function as a template and casting. In general you can write a forwarding overload that casts as appropriate. In Christ, Steven Watanabe