From 31a5c7667294916123b2497c8573726c40aaab5d Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Fri, 22 Dec 2023 15:51:03 +0100 Subject: [PATCH] feat: `interconvertible(QuantitySpec, QuantitySpec)` added --- src/core/include/mp-units/quantity_spec.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/include/mp-units/quantity_spec.h b/src/core/include/mp-units/quantity_spec.h index 5f70d034..c9b242d4 100644 --- a/src/core/include/mp-units/quantity_spec.h +++ b/src/core/include/mp-units/quantity_spec.h @@ -1401,6 +1401,12 @@ template return detail::convertible_impl(from, to) >= detail::specs_convertible_result::cast; } +template +[[nodiscard]] consteval bool interconvertible(QS1 qs1, QS2 qs2) +{ + return implicitly_convertible(qs1, qs2) && implicitly_convertible(qs2, qs1); +} + namespace detail { template