fix: min and max compilation issues resolved

This commit is contained in:
Mateusz Pusz
2023-09-26 12:32:26 +02:00
parent eaf51c467c
commit 77cc08ef77
3 changed files with 104 additions and 78 deletions

View File

@@ -132,6 +132,38 @@ constexpr T max(std::initializer_list<T> ilist)
return *max_element(ilist.begin(), ilist.end()); return *max_element(ilist.begin(), ilist.end());
} }
template<class T>
constexpr const T& max(const T& a, const T& b)
{
return (a < b) ? b : a;
}
template<class ForwardIt>
constexpr ForwardIt min_element(ForwardIt first, ForwardIt last)
{
if (first == last) return last;
ForwardIt smallest = first;
++first;
for (; first != last; ++first)
if (*first < *smallest) smallest = first;
return smallest;
}
template<class T>
constexpr T min(std::initializer_list<T> ilist)
{
return *min_element(ilist.begin(), ilist.end());
}
template<class T>
constexpr const T& min(const T& a, const T& b)
{
return (b < a) ? b : a;
}
template<class I, class O> template<class I, class O>
struct in_out_result { struct in_out_result {
[[no_unique_address]] I in; [[no_unique_address]] I in;

View File

@@ -702,7 +702,7 @@ struct explode_result {
template<typename T> template<typename T>
[[nodiscard]] consteval explode_result common_convertibility_with(explode_to_equation_result<T> res) const [[nodiscard]] consteval explode_result common_convertibility_with(explode_to_equation_result<T> res) const
{ {
return {quantity, std::min(result, res.result)}; return {quantity, min(result, res.result)};
} }
}; };
@@ -724,9 +724,9 @@ template<int Complexity, QuantitySpec Q, typename Num, typename... Nums, typenam
{ {
constexpr auto n = get_complexity(Num{}); constexpr auto n = get_complexity(Num{});
constexpr auto d = get_complexity(Den{}); constexpr auto d = get_complexity(Den{});
constexpr auto max = n > d ? n : d; constexpr auto max_compl = n > d ? n : d;
if constexpr (max == Complexity || ((n >= d && !requires { explode_to_equation(Num{}); }) || if constexpr (max_compl == Complexity || ((n >= d && !requires { explode_to_equation(Num{}); }) ||
(n < d && !requires { explode_to_equation(Den{}); }))) (n < d && !requires { explode_to_equation(Den{}); })))
return explode_result{(map_power(Num{}) * ... * map_power(Nums{})) / (map_power(Den{}) * ... * map_power(Dens{}))}; return explode_result{(map_power(Num{}) * ... * map_power(Nums{})) / (map_power(Den{}) * ... * map_power(Dens{}))};
else { else {
@@ -932,23 +932,19 @@ template<process_entities Entities, auto Ext, TypeList NumFrom, TypeList DenFrom
if constexpr (Entities == process_entities::numerators || Entities == process_entities::denominators) { if constexpr (Entities == process_entities::numerators || Entities == process_entities::denominators) {
constexpr auto res = convertible_impl(Ext.from, Ext.to); constexpr auto res = convertible_impl(Ext.from, Ext.to);
if constexpr (Ext.prepend == prepend_rest::no) if constexpr (Ext.prepend == prepend_rest::no)
return std::min(res, are_ingredients_convertible(num_from, den_from, num_to, den_to)); return min(res, are_ingredients_convertible(num_from, den_from, num_to, den_to));
else { else {
using elem = std::remove_cvref_t<decltype(Ext.elem)>; using elem = std::remove_cvref_t<decltype(Ext.elem)>;
if constexpr (Entities == process_entities::numerators) { if constexpr (Entities == process_entities::numerators) {
if constexpr (Ext.prepend == prepend_rest::first) if constexpr (Ext.prepend == prepend_rest::first)
return std::min(res, return min(res, are_ingredients_convertible(type_list_push_front<NumFrom, elem>{}, den_from, num_to, den_to));
are_ingredients_convertible(type_list_push_front<NumFrom, elem>{}, den_from, num_to, den_to));
else else
return std::min(res, return min(res, are_ingredients_convertible(num_from, den_from, type_list_push_front<NumTo, elem>{}, den_to));
are_ingredients_convertible(num_from, den_from, type_list_push_front<NumTo, elem>{}, den_to));
} else { } else {
if constexpr (Ext.prepend == prepend_rest::first) if constexpr (Ext.prepend == prepend_rest::first)
return std::min(res, return min(res, are_ingredients_convertible(num_from, type_list_push_front<DenFrom, elem>{}, num_to, den_to));
are_ingredients_convertible(num_from, type_list_push_front<DenFrom, elem>{}, num_to, den_to));
else else
return std::min(res, return min(res, are_ingredients_convertible(num_from, den_from, num_to, type_list_push_front<DenTo, elem>{}));
are_ingredients_convertible(num_from, den_from, num_to, type_list_push_front<DenTo, elem>{}));
} }
} }
} else { } else {
@@ -995,27 +991,27 @@ template<typename NumFrom, typename... NumsFrom, typename DenFrom, typename... D
constexpr auto den_from_compl = get_complexity(DenFrom{}); constexpr auto den_from_compl = get_complexity(DenFrom{});
constexpr auto num_to_compl = get_complexity(NumTo{}); constexpr auto num_to_compl = get_complexity(NumTo{});
constexpr auto den_to_compl = get_complexity(DenTo{}); constexpr auto den_to_compl = get_complexity(DenTo{});
constexpr auto max = std::max({num_from_compl, num_to_compl, den_from_compl, den_to_compl}); constexpr auto max_compl = max({num_from_compl, num_to_compl, den_from_compl, den_to_compl});
if constexpr (max > 1) { if constexpr (max_compl > 1) {
if constexpr (num_from_compl == max) { if constexpr (num_from_compl == max_compl) {
constexpr auto res = explode_to_equation(NumFrom{}); constexpr auto res = explode_to_equation(NumFrom{});
return convertible_impl( return convertible_impl(
(res.equation * ... * map_power(NumsFrom{})) / (map_power(DenFrom{}) * ... * map_power(DensFrom{})), (res.equation * ... * map_power(NumsFrom{})) / (map_power(DenFrom{}) * ... * map_power(DensFrom{})),
(map_power(NumTo{}) * ... * map_power(NumsTo{})) / (map_power(DenTo{}) * ... * map_power(DensTo{}))); (map_power(NumTo{}) * ... * map_power(NumsTo{})) / (map_power(DenTo{}) * ... * map_power(DensTo{})));
} else if constexpr (den_from_compl == max) { } else if constexpr (den_from_compl == max_compl) {
constexpr auto res = explode_to_equation(DenFrom{}); constexpr auto res = explode_to_equation(DenFrom{});
return convertible_impl( return convertible_impl(
(map_power(NumFrom{}) * ... * map_power(NumsFrom{})) / (res.equation * ... * map_power(DensFrom{})), (map_power(NumFrom{}) * ... * map_power(NumsFrom{})) / (res.equation * ... * map_power(DensFrom{})),
(map_power(NumTo{}) * ... * map_power(NumsTo{})) / (map_power(DenTo{}) * ... * map_power(DensTo{}))); (map_power(NumTo{}) * ... * map_power(NumsTo{})) / (map_power(DenTo{}) * ... * map_power(DensTo{})));
} else if constexpr (num_to_compl == max) { } else if constexpr (num_to_compl == max_compl) {
constexpr auto res = explode_to_equation(NumTo{}); constexpr auto res = explode_to_equation(NumTo{});
return std::min(res.result, convertible_impl((map_power(NumFrom{}) * ... * map_power(NumsFrom{})) / return min(res.result, convertible_impl((map_power(NumFrom{}) * ... * map_power(NumsFrom{})) /
(map_power(DenFrom{}) * ... * map_power(DensFrom{})), (map_power(DenFrom{}) * ... * map_power(DensFrom{})),
(res.equation * ... * map_power(NumsTo{})) / (res.equation * ... * map_power(NumsTo{})) /
(map_power(DenTo{}) * ... * map_power(DensTo{})))); (map_power(DenTo{}) * ... * map_power(DensTo{}))));
} else { } else {
constexpr auto res = explode_to_equation(DenTo{}); constexpr auto res = explode_to_equation(DenTo{});
return std::min(res.result, convertible_impl((map_power(NumFrom{}) * ... * map_power(NumsFrom{})) / return min(res.result, convertible_impl((map_power(NumFrom{}) * ... * map_power(NumsFrom{})) /
(map_power(DenFrom{}) * ... * map_power(DensFrom{})), (map_power(DenFrom{}) * ... * map_power(DensFrom{})),
(map_power(NumTo{}) * ... * map_power(NumsTo{})) / (map_power(NumTo{}) * ... * map_power(NumsTo{})) /
(res.equation * ... * map_power(DensTo{})))); (res.equation * ... * map_power(DensTo{}))));
@@ -1041,25 +1037,23 @@ template<typename DenFrom, typename... DensFrom, typename NumTo, typename... Num
constexpr auto den_from_compl = get_complexity(DenFrom{}); constexpr auto den_from_compl = get_complexity(DenFrom{});
constexpr auto num_to_compl = get_complexity(NumTo{}); constexpr auto num_to_compl = get_complexity(NumTo{});
constexpr auto den_to_compl = get_complexity(DenTo{}); constexpr auto den_to_compl = get_complexity(DenTo{});
constexpr auto max = std::max({num_to_compl, den_from_compl, den_to_compl}); constexpr auto max_compl = max({num_to_compl, den_from_compl, den_to_compl});
if constexpr (max > 1) { if constexpr (max_compl > 1) {
if constexpr (den_from_compl == max) { if constexpr (den_from_compl == max_compl) {
constexpr auto res = explode_to_equation(DenFrom{}); constexpr auto res = explode_to_equation(DenFrom{});
return convertible_impl( return convertible_impl(
dimensionless / (res.equation * ... * map_power(DensFrom{})), dimensionless / (res.equation * ... * map_power(DensFrom{})),
(map_power(NumTo{}) * ... * map_power(NumsTo{})) / (map_power(DenTo{}) * ... * map_power(DensTo{}))); (map_power(NumTo{}) * ... * map_power(NumsTo{})) / (map_power(DenTo{}) * ... * map_power(DensTo{})));
} else if constexpr (num_to_compl == max) { } else if constexpr (num_to_compl == max_compl) {
constexpr auto res = explode_to_equation(NumTo{}); constexpr auto res = explode_to_equation(NumTo{});
return std::min( return min(res.result, convertible_impl(dimensionless / (map_power(DenFrom{}) * ... * map_power(DensFrom{})),
res.result, convertible_impl( (res.equation * ... * map_power(NumsTo{})) /
dimensionless / (map_power(DenFrom{}) * ... * map_power(DensFrom{})), (map_power(DenTo{}) * ... * map_power(DensTo{}))));
(res.equation * ... * map_power(NumsTo{})) / (map_power(DenTo{}) * ... * map_power(DensTo{}))));
} else { } else {
constexpr auto res = explode_to_equation(DenTo{}); constexpr auto res = explode_to_equation(DenTo{});
return std::min( return min(res.result, convertible_impl(dimensionless / (map_power(DenFrom{}) * ... * map_power(DensFrom{})),
res.result, convertible_impl( (map_power(NumTo{}) * ... * map_power(NumsTo{})) /
dimensionless / (map_power(DenFrom{}) * ... * map_power(DensFrom{})), (res.equation * ... * map_power(DensTo{}))));
(map_power(NumTo{}) * ... * map_power(NumsTo{})) / (res.equation * ... * map_power(DensTo{}))));
} }
} }
} }
@@ -1082,21 +1076,21 @@ template<typename NumFrom, typename... NumsFrom, typename NumTo, typename... Num
constexpr auto num_from_compl = get_complexity(NumFrom{}); constexpr auto num_from_compl = get_complexity(NumFrom{});
constexpr auto num_to_compl = get_complexity(NumTo{}); constexpr auto num_to_compl = get_complexity(NumTo{});
constexpr auto den_to_compl = get_complexity(DenTo{}); constexpr auto den_to_compl = get_complexity(DenTo{});
constexpr auto max = std::max({num_from_compl, num_to_compl, den_to_compl}); constexpr auto max_compl = max({num_from_compl, num_to_compl, den_to_compl});
if constexpr (max > 1) { if constexpr (max_compl > 1) {
if constexpr (num_from_compl == max) { if constexpr (num_from_compl == max_compl) {
constexpr auto res = explode_to_equation(NumFrom{}); constexpr auto res = explode_to_equation(NumFrom{});
return convertible_impl( return convertible_impl(
(res.equation * ... * map_power(NumsFrom{})), (res.equation * ... * map_power(NumsFrom{})),
(map_power(NumTo{}) * ... * map_power(NumsTo{})) / (map_power(DenTo{}) * ... * map_power(DensTo{}))); (map_power(NumTo{}) * ... * map_power(NumsTo{})) / (map_power(DenTo{}) * ... * map_power(DensTo{})));
} else if constexpr (num_to_compl == max) { } else if constexpr (num_to_compl == max_compl) {
constexpr auto res = explode_to_equation(NumTo{}); constexpr auto res = explode_to_equation(NumTo{});
return std::min(res.result, convertible_impl((map_power(NumFrom{}) * ... * map_power(NumsFrom{})), return min(res.result, convertible_impl((map_power(NumFrom{}) * ... * map_power(NumsFrom{})),
(res.equation * ... * map_power(NumsTo{})) / (res.equation * ... * map_power(NumsTo{})) /
(map_power(DenTo{}) * ... * map_power(DensTo{})))); (map_power(DenTo{}) * ... * map_power(DensTo{}))));
} else { } else {
constexpr auto res = explode_to_equation(DenTo{}); constexpr auto res = explode_to_equation(DenTo{});
return std::min(res.result, convertible_impl((map_power(NumFrom{}) * ... * map_power(NumsFrom{})), return min(res.result, convertible_impl((map_power(NumFrom{}) * ... * map_power(NumsFrom{})),
(map_power(NumTo{}) * ... * map_power(NumsTo{})) / (map_power(NumTo{}) * ... * map_power(NumsTo{})) /
(res.equation * ... * map_power(DensTo{})))); (res.equation * ... * map_power(DensTo{}))));
} }
@@ -1122,21 +1116,21 @@ template<typename NumFrom, typename... NumsFrom, typename DenFrom, typename... D
constexpr auto num_from_compl = get_complexity(NumFrom{}); constexpr auto num_from_compl = get_complexity(NumFrom{});
constexpr auto den_from_compl = get_complexity(DenFrom{}); constexpr auto den_from_compl = get_complexity(DenFrom{});
constexpr auto den_to_compl = get_complexity(DenTo{}); constexpr auto den_to_compl = get_complexity(DenTo{});
constexpr auto max = std::max({num_from_compl, den_from_compl, den_to_compl}); constexpr auto max_compl = max({num_from_compl, den_from_compl, den_to_compl});
if constexpr (max > 1) { if constexpr (max_compl > 1) {
if constexpr (num_from_compl == max) { if constexpr (num_from_compl == max_compl) {
constexpr auto res = explode_to_equation(NumFrom{}); constexpr auto res = explode_to_equation(NumFrom{});
return convertible_impl( return convertible_impl(
(res.equation * ... * map_power(NumsFrom{})) / (map_power(DenFrom{}) * ... * map_power(DensFrom{})), (res.equation * ... * map_power(NumsFrom{})) / (map_power(DenFrom{}) * ... * map_power(DensFrom{})),
dimensionless / (map_power(DenTo{}) * ... * map_power(DensTo{}))); dimensionless / (map_power(DenTo{}) * ... * map_power(DensTo{})));
} else if constexpr (den_from_compl == max) { } else if constexpr (den_from_compl == max_compl) {
constexpr auto res = explode_to_equation(DenFrom{}); constexpr auto res = explode_to_equation(DenFrom{});
return convertible_impl( return convertible_impl(
(map_power(NumFrom{}) * ... * map_power(NumsFrom{})) / (res.equation * ... * map_power(DensFrom{})), (map_power(NumFrom{}) * ... * map_power(NumsFrom{})) / (res.equation * ... * map_power(DensFrom{})),
dimensionless / (map_power(DenTo{}) * ... * map_power(DensTo{}))); dimensionless / (map_power(DenTo{}) * ... * map_power(DensTo{})));
} else { } else {
constexpr auto res = explode_to_equation(DenTo{}); constexpr auto res = explode_to_equation(DenTo{});
return std::min(res.result, convertible_impl((map_power(NumFrom{}) * ... * map_power(NumsFrom{})) / return min(res.result, convertible_impl((map_power(NumFrom{}) * ... * map_power(NumsFrom{})) /
(map_power(DenFrom{}) * ... * map_power(DensFrom{})), (map_power(DenFrom{}) * ... * map_power(DensFrom{})),
dimensionless / (res.equation * ... * map_power(DensTo{})))); dimensionless / (res.equation * ... * map_power(DensTo{}))));
} }
@@ -1162,21 +1156,21 @@ template<typename NumFrom, typename... NumsFrom, typename DenFrom, typename... D
constexpr auto num_from_compl = get_complexity(NumFrom{}); constexpr auto num_from_compl = get_complexity(NumFrom{});
constexpr auto den_from_compl = get_complexity(DenFrom{}); constexpr auto den_from_compl = get_complexity(DenFrom{});
constexpr auto num_to_compl = get_complexity(NumTo{}); constexpr auto num_to_compl = get_complexity(NumTo{});
constexpr auto max = std::max({num_from_compl, num_to_compl, den_from_compl}); constexpr auto max_compl = max({num_from_compl, num_to_compl, den_from_compl});
if constexpr (max > 1) { if constexpr (max_compl > 1) {
if constexpr (num_from_compl == max) { if constexpr (num_from_compl == max_compl) {
constexpr auto res = explode_to_equation(NumFrom{}); constexpr auto res = explode_to_equation(NumFrom{});
return convertible_impl( return convertible_impl(
(res.equation * ... * map_power(NumsFrom{})) / (map_power(DenFrom{}) * ... * map_power(DensFrom{})), (res.equation * ... * map_power(NumsFrom{})) / (map_power(DenFrom{}) * ... * map_power(DensFrom{})),
(map_power(NumTo{}) * ... * map_power(NumsTo{}))); (map_power(NumTo{}) * ... * map_power(NumsTo{})));
} else if constexpr (den_from_compl == max) { } else if constexpr (den_from_compl == max_compl) {
constexpr auto res = explode_to_equation(DenFrom{}); constexpr auto res = explode_to_equation(DenFrom{});
return convertible_impl( return convertible_impl(
(map_power(NumFrom{}) * ... * map_power(NumsFrom{})) / (res.equation * ... * map_power(DensFrom{})), (map_power(NumFrom{}) * ... * map_power(NumsFrom{})) / (res.equation * ... * map_power(DensFrom{})),
(map_power(NumTo{}) * ... * map_power(NumsTo{}))); (map_power(NumTo{}) * ... * map_power(NumsTo{})));
} else { } else {
constexpr auto res = explode_to_equation(NumTo{}); constexpr auto res = explode_to_equation(NumTo{});
return std::min(res.result, convertible_impl((map_power(NumFrom{}) * ... * map_power(NumsFrom{})) / return min(res.result, convertible_impl((map_power(NumFrom{}) * ... * map_power(NumsFrom{})) /
(map_power(DenFrom{}) * ... * map_power(DensFrom{})), (map_power(DenFrom{}) * ... * map_power(DensFrom{})),
(res.equation * ... * map_power(NumsTo{})))); (res.equation * ... * map_power(NumsTo{}))));
} }
@@ -1197,15 +1191,15 @@ template<typename NumFrom, typename... NumsFrom, typename NumTo, typename... Num
} else { } else {
constexpr auto num_from_compl = get_complexity(NumFrom{}); constexpr auto num_from_compl = get_complexity(NumFrom{});
constexpr auto num_to_compl = get_complexity(NumTo{}); constexpr auto num_to_compl = get_complexity(NumTo{});
constexpr auto max = std::max({num_from_compl, num_to_compl}); constexpr auto max_compl = max(num_from_compl, num_to_compl);
if constexpr (max > 1) { if constexpr (max_compl > 1) {
if constexpr (num_from_compl == max) { if constexpr (num_from_compl == max_compl) {
constexpr auto res = explode_to_equation(NumFrom{}); constexpr auto res = explode_to_equation(NumFrom{});
return convertible_impl((res.equation * ... * map_power(NumsFrom{})), return convertible_impl((res.equation * ... * map_power(NumsFrom{})),
(map_power(NumTo{}) * ... * map_power(NumsTo{}))); (map_power(NumTo{}) * ... * map_power(NumsTo{})));
} else { } else {
constexpr auto res = explode_to_equation(NumTo{}); constexpr auto res = explode_to_equation(NumTo{});
return std::min(res.result, convertible_impl((map_power(NumFrom{}) * ... * map_power(NumsFrom{})), return min(res.result, convertible_impl((map_power(NumFrom{}) * ... * map_power(NumsFrom{})),
(res.equation * ... * map_power(NumsTo{})))); (res.equation * ... * map_power(NumsTo{}))));
} }
} }
@@ -1225,16 +1219,15 @@ template<typename DenFrom, typename... DensFrom, typename DenTo, typename... Den
else { else {
constexpr auto den_from_compl = get_complexity(DenFrom{}); constexpr auto den_from_compl = get_complexity(DenFrom{});
constexpr auto den_to_compl = get_complexity(DenTo{}); constexpr auto den_to_compl = get_complexity(DenTo{});
constexpr auto max = std::max({den_from_compl, den_to_compl}); constexpr auto max_compl = max(den_from_compl, den_to_compl);
if constexpr (max > 1) { if constexpr (max_compl > 1) {
if constexpr (den_from_compl == max) { if constexpr (den_from_compl == max_compl) {
constexpr auto res = explode_to_equation(DenFrom{}); constexpr auto res = explode_to_equation(DenFrom{});
return convertible_impl(dimensionless / (res.equation * ... * map_power(DensFrom{})), return convertible_impl(dimensionless / (res.equation * ... * map_power(DensFrom{})),
dimensionless / (map_power(DenTo{}) * ... * map_power(DensTo{}))); dimensionless / (map_power(DenTo{}) * ... * map_power(DensTo{})));
} else { } else {
constexpr auto res = explode_to_equation(DenTo{}); constexpr auto res = explode_to_equation(DenTo{});
return std::min(res.result, return min(res.result, convertible_impl(dimensionless / (map_power(DenFrom{}) * ... * map_power(DensFrom{})),
convertible_impl(dimensionless / (map_power(DenFrom{}) * ... * map_power(DensFrom{})),
dimensionless / (res.equation * ... * map_power(DensTo{})))); dimensionless / (res.equation * ... * map_power(DensTo{}))));
} }
} }
@@ -1375,7 +1368,7 @@ template<QuantitySpec From, QuantitySpec To>
return convertible_impl(explode<get_complexity(to)>(from).quantity, to); return convertible_impl(explode<get_complexity(to)>(from).quantity, to);
else { else {
constexpr auto res = explode<get_complexity(from)>(to); constexpr auto res = explode<get_complexity(from)>(to);
return std::min(res.result, convertible_impl(from, res.quantity)); return min(res.result, convertible_impl(from, res.quantity));
} }
} }
} else if constexpr (IntermediateDerivedQuantitySpec<From> && IntermediateDerivedQuantitySpec<To>) { } else if constexpr (IntermediateDerivedQuantitySpec<From> && IntermediateDerivedQuantitySpec<To>) {
@@ -1386,17 +1379,17 @@ template<QuantitySpec From, QuantitySpec To>
return convertible_impl(res.quantity, to); return convertible_impl(res.quantity, to);
else if constexpr (requires { to._equation_; }) { else if constexpr (requires { to._equation_; }) {
constexpr auto eq = explode_to_equation(to); constexpr auto eq = explode_to_equation(to);
return std::min(eq.result, convertible_impl(res.quantity, eq.equation)); return min(eq.result, convertible_impl(res.quantity, eq.equation));
} else } else
return are_ingredients_convertible(from, to); return are_ingredients_convertible(from, to);
} else if constexpr (IntermediateDerivedQuantitySpec<To>) { } else if constexpr (IntermediateDerivedQuantitySpec<To>) {
auto res = explode<get_complexity(from)>(to); auto res = explode<get_complexity(from)>(to);
if constexpr (NamedQuantitySpec<std::remove_const_t<decltype(res.quantity)>>) if constexpr (NamedQuantitySpec<std::remove_const_t<decltype(res.quantity)>>)
return std::min(res.result, convertible_impl(from, res.quantity)); return min(res.result, convertible_impl(from, res.quantity));
else if constexpr (requires { from._equation_; }) else if constexpr (requires { from._equation_; })
return std::min(res.result, convertible_impl(from._equation_, res.quantity)); return min(res.result, convertible_impl(from._equation_, res.quantity));
else else
return std::min(res.result, are_ingredients_convertible(from, to)); return min(res.result, are_ingredients_convertible(from, to));
} }
return no; return no;
} }

View File

@@ -23,6 +23,7 @@
#include <catch2/matchers/catch_matchers_templated.hpp> #include <catch2/matchers/catch_matchers_templated.hpp>
#include <mp-units/format.h> #include <mp-units/format.h>
#include <mp-units/quantity.h> #include <mp-units/quantity.h>
#include <algorithm>
namespace mp_units { namespace mp_units {