mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-30 18:37:15 +02:00
refactor: clang has issues with CTAD for aggregates
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
@ -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>&);
|
||||
|
||||
|
Reference in New Issue
Block a user