I need to pass the value of a quantity to a library for evaluation. The boost units library takes double values in SI, so the boost units library is very appealing in ensuring that requirement. However, how should I cast the quantity to a double value? The documentation and example seems to avoid this since the intent is to, rightfully so, maintain the units.
Something like:
quantity<pressure> p(101.1 * kilo * pascals);
double dblP = static_cast<double>(p); // double value in Pascals
Going through the headers suggests... Is that the correct way to cast to the base type?
p.value();
p.value()
" So your question is? – Undershot