Closed mpusz closed 4 months ago
This PR improves types readability.
-error: could not convert 'speed' from 'quantity<derived_unit<si::kilo_<si::metre()>, per<non_si::hour>>()>' +error: could not convert 'speed' from 'quantity<derived_unit<si::kilo_<si::metre>, per<non_si::hour>>()>' to 'quantity<si::metre()>' 50 | std::println("TTG: {:{%N:.6} %U}", | time_to_goal(speed, distance_m)); | ^~~~~ | | - | quantity<derived_unit<si::kilo_<si::metre()>, per<non_si::hour>>()> + | quantity<derived_unit<si::kilo_<si::metre>, per<non_si::hour>>()> Compiler returned: 1
error: no matching function for call to 'time_to_goal' 22 | const quantity ttg = time_to_goal(half_marathon_distance, pace); | ^~~~~~~~~~~~ -note: candidate template ignored: constraints not satisfied [with distance:auto = quantity<kilo_<metre{{}}>{}, double>, - speed:auto = quantity<derived_unit<second, per<kilo_<metre{{}}>>>{}, double>] +note: candidate template ignored: constraints not satisfied [with distance:auto = quantity<kilo_<metre>{}, double>, + speed:auto = quantity<derived_unit<second, per<kilo_<metre>>>{}, double>] 12 | QuantityOf<isq::time> auto time_to_goal(QuantityOf<isq::length> auto distance, | ^ -note: because 'QuantityOf<quantity<derived_unit<si::second, per<si::kilo_<si::metre{{}}>>>{{{}}}>, isq::speed>' evaluated to false +note: because 'QuantityOf<quantity<derived_unit<si::second, per<si::kilo_<si::metre>>>{{{}}}>, isq::speed>' evaluated to false 13 | QuantityOf<isq::speed> auto speed) | ^ -note: because 'QuantitySpecOf<std::remove_const_t<decltype(get_quantity_spec(derived_unit<second, per<kilo_<metre{{}}>>>{}))>, struct speed{{{}}}>' evaluated to false +note: because 'QuantitySpecOf<std::remove_const_t<decltype(get_quantity_spec(derived_unit<second, per<kilo_<metre>>>{}))>, struct speed{{{}}}>' evaluated to false 77 | QuantitySpecOf<std::remove_const_t<decltype(get_quantity_spec(T{}))>, V>); | ^ note: because 'implicitly_convertible(kind_of_<derived_quantity_spec<isq::time, per<isq::length>>{{}, {{}}}>{}, struct speed{{{}}})' evaluated to false 147 | QuantitySpec<T> && QuantitySpec<std::remove_const_t<decltype(QS)>> && implicitly_convertible(T{}, QS) && | ^ 1 error generated. Compiler returned: 1
Is it worth it?
This PR improves types readability.
Is it worth it?