From d820cfe6cf5899dde06ced6a9f447450b604f416 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Fri, 30 Jun 2023 17:28:01 +0100 Subject: [PATCH] feat: `zero()` static member function added to `quantity_point` --- src/core/include/mp-units/quantity_point.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/include/mp-units/quantity_point.h b/src/core/include/mp-units/quantity_point.h index 16f8d62a..56829c29 100644 --- a/src/core/include/mp-units/quantity_point.h +++ b/src/core/include/mp-units/quantity_point.h @@ -83,6 +83,12 @@ public: quantity_type q_; // needs to be public for a structural type // static member functions + [[nodiscard]] static constexpr quantity_point zero() noexcept + requires requires { quantity_type::zero(); } + { + return quantity_point(quantity_type::zero()); + } + [[nodiscard]] static constexpr quantity_point min() noexcept requires requires { quantity_type::min(); } {