Specialize common_type to satisfy comparison concepts (resolves #113)
This commit is contained in:
1 parent
ed9f51c75b
commit
86b9177816
2 files changed
+20
No files matched your search
@@ -64,3 +64,13 @@ template<Quantity Q1, Quantity Q2, Scalar Rep = std::common_type_t<typename Q1::
|
||||
using common_quantity = detail::common_quantity_impl<Q1, Q2, Rep>::type;
|
||||
|
||||
} // namespace units
|
||||
|
||||
namespace std {
|
||||
|
||||
template<units::Quantity Q1, units::Quantity Q2>
|
||||
requires units::equivalent_dim<typename Q1::dimension, typename Q2::dimension>
|
||||
struct common_type<Q1, Q2> {
|
||||
using type = units::common_quantity<Q1, Q2>;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user