
namespace wrap {
template<Unit> void doSomethingWithLength(const quantity<Unit>& q) { return doSomethingWithLength((quantity<si::length>(q)).value()); }
} // namespace wrap
Then you can call wrap::doSomethingWithLength with any unit having length dimension and the argument will be converted to meters and "demarshalled"...
If I understand the way quantity works correctly, this will take a quantity on any length dimension and convert it to a quantity on si::length. What I am attempting to do is manage quantities in units. What I mean by marshalling and demarshalling is this: quantity<si::length> marshall(double value) { return value * us::foot_base_unit(); } double demarshall(const quantity<si::length>& value) { return quantity</*feet*/>(value).value(); } If possible this is the approach I'd like to take, Thanks Justin