fix: convertible_kinds implementation fixed

This commit is contained in:
Mateusz Pusz
2024-11-04 18:02:09 +01:00
parent d249bc1400
commit c45df2a4bd

View File

@@ -1350,13 +1350,11 @@ template<QuantitySpec From, QuantitySpec To>
};
if constexpr ((NamedQuantitySpec<decltype(From{})> && NamedQuantitySpec<decltype(To{})>) ||
get_complexity(From{}) == get_complexity(To{}))
return convertible_impl(from_kind, to_kind);
return exploded_kind_result(convertible_impl(from_kind, to_kind));
else if constexpr (get_complexity(From{}) > get_complexity(To{}))
return exploded_kind_result(
convertible_impl(get_kind_tree_root(explode<get_complexity(To{})>(from_kind).quantity), to_kind));
return exploded_kind_result(convertible_impl(explode<get_complexity(To{})>(from_kind).quantity, to_kind));
else
return exploded_kind_result(
convertible_impl(from_kind, get_kind_tree_root(explode<get_complexity(From{})>(to_kind).quantity)));
return exploded_kind_result(convertible_impl(from_kind, explode<get_complexity(From{})>(to_kind).quantity));
}
template<NamedQuantitySpec From, NamedQuantitySpec To>