refactor: clang has issues with CTAD for aggregates

This commit is contained in:
Mateusz Pusz
2023-06-15 17:28:35 +03:00
parent 6d488071fc
commit d380aa3800
2 changed files with 28 additions and 0 deletions

View File

@ -658,6 +658,13 @@ struct explode_to_equation_result {
specs_convertible_result result;
};
#if UNITS_COMP_CLANG
template<QuantitySpec Q>
explode_to_equation_result(Q, specs_convertible_result) -> explode_to_equation_result<Q>;
#endif
template<QuantitySpec Q>
requires requires { Q::_equation_; }
[[nodiscard]] consteval auto explode_to_equation(Q q)
@ -688,6 +695,13 @@ struct explode_result {
}
};
#if UNITS_COMP_CLANG
template<QuantitySpec Q>
explode_result(Q) -> explode_result<Q>;
#endif
template<int Complexity, IntermediateDerivedQuantitySpec Q>
[[nodiscard]] consteval auto explode(Q q);
@ -851,6 +865,13 @@ struct extract_results {
Elem elem{};
};
#if UNITS_COMP_CLANG
template<typename... Ts>
extract_results(bool, Ts...) -> extract_results<Ts...>;
#endif
template<typename From, typename To>
[[nodiscard]] consteval auto extract_convertible_quantities(From from, To to)
{

View File

@ -282,6 +282,13 @@ struct canonical_unit {
U reference_unit;
};
#if UNITS_COMP_CLANG
template<Magnitude M, Unit U>
canonical_unit(M, U) -> canonical_unit<M, U>;
#endif
template<Unit T, basic_symbol_text Symbol, detail::QuantityKindSpec auto Q>
[[nodiscard]] consteval auto get_canonical_unit_impl(T t, const named_unit<Symbol, Q>&);