forked from mpusz/mp-units
refactor: square and cubic are now functions (not variable templates)
This commit is contained in:
@@ -126,7 +126,7 @@ void calcs_comparison()
|
||||
|
||||
std::cout << "In multiplication and division:\n\n";
|
||||
|
||||
const quantity<isq::area[square<fm>], float> ArA = L1A * L2A;
|
||||
const quantity<isq::area[square(fm)], float> ArA = L1A * L2A;
|
||||
std::cout << UNITS_STD_FMT::format("{:%.30Q %q}\n * {:%.30Q %q}\n = {:%.30Q %q}\n\n", L1A, L2A, ArA);
|
||||
|
||||
std::cout << "similar problems arise\n\n";
|
||||
|
||||
@@ -58,7 +58,7 @@ auto fmt_line(const Q& q)
|
||||
// Print the ship details in the units as defined in the Ship struct, in other si::imperial units, and in SI
|
||||
void print_details(std::string_view description, const Ship& ship)
|
||||
{
|
||||
const auto waterDensity = 62.4 * isq::density[lb / cubic<ft>];
|
||||
const auto waterDensity = 62.4 * isq::density[lb / cubic(ft)];
|
||||
std::cout << UNITS_STD_FMT::format("{}\n", description);
|
||||
std::cout << UNITS_STD_FMT::format("{:20} : {}\n", "length", fmt_line<yd, m>(ship.length))
|
||||
<< UNITS_STD_FMT::format("{:20} : {}\n", "draft", fmt_line<yd, m>(ship.draft))
|
||||
|
||||
Reference in New Issue
Block a user