feat: value_cast support added

Resolves #239 and #120
This commit is contained in:
Mateusz Pusz
2023-02-03 11:08:13 +01:00
parent cf3408a3c8
commit b4f47c3fef
19 changed files with 220 additions and 212 deletions

View File

@@ -85,11 +85,11 @@ void print(const R& gliders)
std::cout << "- Name: " << g.name << "\n";
std::cout << "- Polar:\n";
for (const auto& p : g.polar) {
const auto ratio = quantity_cast<one>(glide_ratio(g.polar[0]));
const auto ratio = value_cast<one>(glide_ratio(g.polar[0]));
std::cout << STD_FMT::format(" * {:%.4Q %q} @ {:%.1Q %q} -> {:%.1Q %q} ({:%.1Q %q})\n", p.climb, p.v, ratio,
// TODO is it possible to make ADL work below (we need another set of trig functions
// for strong angle in a different namespace)
quantity_cast<si::degree>(isq::asin(1 / ratio)));
value_cast<si::degree>(isq::asin(1 / ratio)));
}
std::cout << "\n";
}