From 683c49bef3ed133e448e4ad1b08b17bfee3f6d5f Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 28 Nov 2023 14:19:04 +0100 Subject: [PATCH] style: clang-format updated to 17.0.5 in pre-commit --- .pre-commit-config.yaml | 2 +- src/core/include/mp-units/quantity.h | 18 +++++++++--------- src/core/include/mp-units/quantity_point.h | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2254f222..fcfc2f8e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: - id: trailing-whitespace - id: end-of-file-fixer - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v17.0.3 + rev: v17.0.5 hooks: - id: clang-format - repo: https://github.com/cheshirekow/cmake-format-precommit diff --git a/src/core/include/mp-units/quantity.h b/src/core/include/mp-units/quantity.h index 78839161..b5f2e7d9 100644 --- a/src/core/include/mp-units/quantity.h +++ b/src/core/include/mp-units/quantity.h @@ -266,7 +266,7 @@ public: } template - friend constexpr decltype(auto) operator++(Q && q) + friend constexpr decltype(auto) operator++(Q&& q) requires std::derived_from, quantity> && requires(rep v) { { ++v @@ -288,7 +288,7 @@ public: } template - friend constexpr decltype(auto) operator--(Q && q) + friend constexpr decltype(auto) operator--(Q&& q) requires std::derived_from, quantity> && requires(rep v) { { --v @@ -316,7 +316,7 @@ public: a += b } -> std::same_as; } - friend constexpr decltype(auto) operator+=(Q && lhs, const quantity & rhs) + friend constexpr decltype(auto) operator+=(Q&& lhs, const quantity& rhs) { lhs.numerical_value_is_an_implementation_detail_ += rhs.numerical_value_is_an_implementation_detail_; return std::forward(lhs); @@ -328,7 +328,7 @@ public: a -= b } -> std::same_as; } - friend constexpr decltype(auto) operator-=(Q && lhs, const quantity & rhs) + friend constexpr decltype(auto) operator-=(Q&& lhs, const quantity& rhs) { lhs.numerical_value_is_an_implementation_detail_ -= rhs.numerical_value_is_an_implementation_detail_; return std::forward(lhs); @@ -341,7 +341,7 @@ public: a %= b } -> std::same_as; } - friend constexpr decltype(auto) operator%=(Q && lhs, const quantity & rhs) + friend constexpr decltype(auto) operator%=(Q&& lhs, const quantity& rhs) { gsl_ExpectsAudit(rhs != zero()); @@ -356,7 +356,7 @@ public: a *= b } -> std::same_as; } - friend constexpr decltype(auto) operator*=(Q && lhs, const Value & v) + friend constexpr decltype(auto) operator*=(Q&& lhs, const Value& v) { lhs.numerical_value_is_an_implementation_detail_ *= v; return std::forward(lhs); @@ -369,7 +369,7 @@ public: a *= b } -> std::same_as; } - friend constexpr decltype(auto) operator*=(Q1 && lhs, const Q2 & rhs) + friend constexpr decltype(auto) operator*=(Q1&& lhs, const Q2& rhs) { lhs.numerical_value_is_an_implementation_detail_ *= rhs.numerical_value_is_an_implementation_detail_; return std::forward(lhs); @@ -382,7 +382,7 @@ public: a /= b } -> std::same_as; } - friend constexpr decltype(auto) operator/=(Q && lhs, const Value & v) + friend constexpr decltype(auto) operator/=(Q&& lhs, const Value& v) { gsl_ExpectsAudit(v != quantity_values::zero()); lhs.numerical_value_is_an_implementation_detail_ /= v; @@ -396,7 +396,7 @@ public: a /= b } -> std::same_as; } - friend constexpr decltype(auto) operator/=(Q1 && lhs, const Q2 & rhs) + friend constexpr decltype(auto) operator/=(Q1&& lhs, const Q2& rhs) { gsl_ExpectsAudit(rhs != rhs.zero()); lhs.numerical_value_is_an_implementation_detail_ /= rhs.numerical_value_is_an_implementation_detail_; diff --git a/src/core/include/mp-units/quantity_point.h b/src/core/include/mp-units/quantity_point.h index 3d7a00ed..aa8a3790 100644 --- a/src/core/include/mp-units/quantity_point.h +++ b/src/core/include/mp-units/quantity_point.h @@ -241,7 +241,7 @@ public: // member unary operators template - friend constexpr decltype(auto) operator++(QP && qp) + friend constexpr decltype(auto) operator++(QP&& qp) requires std::derived_from, quantity_point> && requires { ++qp.quantity_from_origin_is_an_implementation_detail_; } { @@ -256,7 +256,7 @@ public: } template - friend constexpr decltype(auto) operator--(QP && qp) + friend constexpr decltype(auto) operator--(QP&& qp) requires std::derived_from, quantity_point> && requires { --qp.quantity_from_origin_is_an_implementation_detail_; } { @@ -274,7 +274,7 @@ public: template requires std::derived_from, quantity_point> && requires(quantity_type q) { quantity_from_origin_is_an_implementation_detail_ += q; } - friend constexpr decltype(auto) operator+=(QP && qp, const quantity_type & q) + friend constexpr decltype(auto) operator+=(QP&& qp, const quantity_type& q) { qp.quantity_from_origin_is_an_implementation_detail_ += q; return std::forward(qp); @@ -283,7 +283,7 @@ public: template requires std::derived_from, quantity_point> && requires(quantity_type q) { quantity_from_origin_is_an_implementation_detail_ -= q; } - friend constexpr decltype(auto) operator-=(QP && qp, const quantity_type & q) + friend constexpr decltype(auto) operator-=(QP&& qp, const quantity_type& q) { qp.quantity_from_origin_is_an_implementation_detail_ -= q; return std::forward(qp);