mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-02 11:54:27 +02:00
refactor(example): gcc-11 ICE on the previous code
This commit is contained in:
@@ -51,8 +51,7 @@ constexpr QuantityOf<isq::speed> auto avg_speed(QuantityOf<isq::length> auto d,
|
|||||||
template<QuantityOf<isq::length> D, QuantityOf<isq::time> T, QuantityOf<isq::speed> V>
|
template<QuantityOf<isq::length> D, QuantityOf<isq::time> T, QuantityOf<isq::speed> V>
|
||||||
void print_result(D distance, T duration, V speed)
|
void print_result(D distance, T duration, V speed)
|
||||||
{
|
{
|
||||||
using namespace mp_units::si::unit_symbols;
|
const auto result_in_kmph = value_cast<si::kilo<si::metre> / non_si::hour>(speed);
|
||||||
const auto result_in_kmph = value_cast<km / h>(speed);
|
|
||||||
std::cout << "Average speed of a car that makes " << distance << " in " << duration << " is " << result_in_kmph
|
std::cout << "Average speed of a car that makes " << distance << " in " << duration << " is " << result_in_kmph
|
||||||
<< ".\n";
|
<< ".\n";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user