mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-31 02:47:16 +02:00
style: clang-format updated to clang 17
This commit is contained in:
@ -1,6 +1,3 @@
|
|||||||
########################################################################################
|
|
||||||
# NOTE: At least clang-format-16 is needed to format the code of this project correctly
|
|
||||||
########################################################################################
|
|
||||||
---
|
---
|
||||||
BasedOnStyle: Google
|
BasedOnStyle: Google
|
||||||
---
|
---
|
||||||
@ -32,6 +29,11 @@ AccessModifierOffset: -2
|
|||||||
# AcrossComments: false
|
# AcrossComments: false
|
||||||
# AlignCompound: false
|
# AlignCompound: false
|
||||||
# PadOperators: false
|
# PadOperators: false
|
||||||
|
# AlignConsecutiveShortCaseStatements:
|
||||||
|
# Enabled: false
|
||||||
|
# AcrossEmptyLines: false
|
||||||
|
# AcrossComments: false
|
||||||
|
# AlignCaseColons: false
|
||||||
# AlignEscapedNewlines: Left
|
# AlignEscapedNewlines: Left
|
||||||
# AlignOperands: Align
|
# AlignOperands: Align
|
||||||
# AlignTrailingComments:
|
# AlignTrailingComments:
|
||||||
@ -140,6 +142,7 @@ IncludeCategories:
|
|||||||
# JavaScriptQuotes: Leave
|
# JavaScriptQuotes: Leave
|
||||||
# JavaScriptWrapImports: true
|
# JavaScriptWrapImports: true
|
||||||
# KeepEmptyLinesAtTheStartOfBlocks: false
|
# KeepEmptyLinesAtTheStartOfBlocks: false
|
||||||
|
# KeepEmptyLinesAtEOF: false
|
||||||
# LambdaBodyIndentation: Signature
|
# LambdaBodyIndentation: Signature
|
||||||
# LineEnding: DeriveLF
|
# LineEnding: DeriveLF
|
||||||
# MacroBlockBegin: ''
|
# MacroBlockBegin: ''
|
||||||
@ -198,6 +201,7 @@ QualifierAlignment: Left
|
|||||||
# ReferenceAlignment: Pointer
|
# ReferenceAlignment: Pointer
|
||||||
# ReflowComments: true
|
# ReflowComments: true
|
||||||
# RemoveBracesLLVM: false
|
# RemoveBracesLLVM: false
|
||||||
|
# RemoveParentheses: Leave
|
||||||
# RemoveSemicolon: false
|
# RemoveSemicolon: false
|
||||||
# RequiresClausePosition: OwnLine
|
# RequiresClausePosition: OwnLine
|
||||||
# RequiresExpressionIndentation: OuterScope
|
# RequiresExpressionIndentation: OuterScope
|
||||||
@ -215,6 +219,7 @@ SpaceAfterTemplateKeyword: false
|
|||||||
# SpaceBeforeCpp11BracedList: false
|
# SpaceBeforeCpp11BracedList: false
|
||||||
# SpaceBeforeCtorInitializerColon: true
|
# SpaceBeforeCtorInitializerColon: true
|
||||||
# SpaceBeforeInheritanceColon: true
|
# SpaceBeforeInheritanceColon: true
|
||||||
|
# SpaceBeforeJsonColon: false
|
||||||
# SpaceBeforeParens: ControlStatements
|
# SpaceBeforeParens: ControlStatements
|
||||||
SpaceBeforeParensOptions:
|
SpaceBeforeParensOptions:
|
||||||
# AfterControlStatements: true
|
# AfterControlStatements: true
|
||||||
@ -229,16 +234,18 @@ SpaceBeforeParensOptions:
|
|||||||
# SpaceBeforeRangeBasedForLoopColon: true
|
# SpaceBeforeRangeBasedForLoopColon: true
|
||||||
# SpaceBeforeSquareBrackets: false
|
# SpaceBeforeSquareBrackets: false
|
||||||
# SpaceInEmptyBlock: false
|
# SpaceInEmptyBlock: false
|
||||||
# SpaceInEmptyParentheses: false
|
|
||||||
# SpacesBeforeTrailingComments: 2
|
# SpacesBeforeTrailingComments: 2
|
||||||
# SpacesInAngles: Never
|
# SpacesInAngles: Never
|
||||||
# SpacesInConditionalStatement: false
|
|
||||||
# SpacesInContainerLiterals: true
|
# SpacesInContainerLiterals: true
|
||||||
# SpacesInCStyleCastParentheses: false
|
|
||||||
# SpacesInLineCommentPrefix:
|
# SpacesInLineCommentPrefix:
|
||||||
# Minimum: 1
|
# Minimum: 1
|
||||||
# Maximum: -1
|
# Maximum: -1
|
||||||
# SpacesInParentheses: false
|
# SpacesInParens: Never
|
||||||
|
# SpacesInParensOptions:
|
||||||
|
# InCStyleCasts: false
|
||||||
|
# InConditionalStatements: false
|
||||||
|
# InEmptyParentheses: false
|
||||||
|
# Other: false
|
||||||
# SpacesInSquareBrackets: false
|
# SpacesInSquareBrackets: false
|
||||||
# Standard: Auto
|
# Standard: Auto
|
||||||
# StatementAttributeLikeMacros:
|
# StatementAttributeLikeMacros:
|
||||||
@ -248,6 +255,7 @@ SpaceBeforeParensOptions:
|
|||||||
# - QT_REQUIRE_VERSION
|
# - QT_REQUIRE_VERSION
|
||||||
# TabWidth: 8
|
# TabWidth: 8
|
||||||
# UseTab: Never
|
# UseTab: Never
|
||||||
|
# VerilogBreakBetweenInstancePorts: true
|
||||||
# WhitespaceSensitiveMacros:
|
# WhitespaceSensitiveMacros:
|
||||||
# - BOOST_PP_STRINGIZE
|
# - BOOST_PP_STRINGIZE
|
||||||
# - CF_SWIFT_NAME
|
# - CF_SWIFT_NAME
|
||||||
|
@ -11,7 +11,7 @@ repos:
|
|||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||||
rev: v16.0.6
|
rev: v17.0.3
|
||||||
hooks:
|
hooks:
|
||||||
- id: clang-format
|
- id: clang-format
|
||||||
- repo: https://github.com/cheshirekow/cmake-format-precommit
|
- repo: https://github.com/cheshirekow/cmake-format-precommit
|
||||||
|
@ -252,7 +252,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename Q>
|
template<typename Q>
|
||||||
friend constexpr decltype(auto) operator++(Q&& q)
|
friend constexpr decltype(auto) operator++(Q && q)
|
||||||
requires std::derived_from<std::remove_cvref_t<Q>, quantity> && requires(rep v) {
|
requires std::derived_from<std::remove_cvref_t<Q>, quantity> && requires(rep v) {
|
||||||
{
|
{
|
||||||
++v
|
++v
|
||||||
@ -274,7 +274,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename Q>
|
template<typename Q>
|
||||||
friend constexpr decltype(auto) operator--(Q&& q)
|
friend constexpr decltype(auto) operator--(Q && q)
|
||||||
requires std::derived_from<std::remove_cvref_t<Q>, quantity> && requires(rep v) {
|
requires std::derived_from<std::remove_cvref_t<Q>, quantity> && requires(rep v) {
|
||||||
{
|
{
|
||||||
--v
|
--v
|
||||||
@ -302,7 +302,7 @@ public:
|
|||||||
a += b
|
a += b
|
||||||
} -> std::same_as<rep&>;
|
} -> std::same_as<rep&>;
|
||||||
}
|
}
|
||||||
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_;
|
lhs.numerical_value_is_an_implementation_detail_ += rhs.numerical_value_is_an_implementation_detail_;
|
||||||
return std::forward<Q>(lhs);
|
return std::forward<Q>(lhs);
|
||||||
@ -314,7 +314,7 @@ public:
|
|||||||
a -= b
|
a -= b
|
||||||
} -> std::same_as<rep&>;
|
} -> std::same_as<rep&>;
|
||||||
}
|
}
|
||||||
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_;
|
lhs.numerical_value_is_an_implementation_detail_ -= rhs.numerical_value_is_an_implementation_detail_;
|
||||||
return std::forward<Q>(lhs);
|
return std::forward<Q>(lhs);
|
||||||
@ -327,7 +327,7 @@ public:
|
|||||||
a %= b
|
a %= b
|
||||||
} -> std::same_as<rep&>;
|
} -> std::same_as<rep&>;
|
||||||
}
|
}
|
||||||
friend constexpr decltype(auto) operator%=(Q&& lhs, const quantity& rhs)
|
friend constexpr decltype(auto) operator%=(Q && lhs, const quantity & rhs)
|
||||||
|
|
||||||
{
|
{
|
||||||
gsl_ExpectsAudit(rhs != zero());
|
gsl_ExpectsAudit(rhs != zero());
|
||||||
@ -342,7 +342,7 @@ public:
|
|||||||
a *= b
|
a *= b
|
||||||
} -> std::same_as<rep&>;
|
} -> std::same_as<rep&>;
|
||||||
}
|
}
|
||||||
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;
|
lhs.numerical_value_is_an_implementation_detail_ *= v;
|
||||||
return std::forward<Q>(lhs);
|
return std::forward<Q>(lhs);
|
||||||
@ -355,7 +355,7 @@ public:
|
|||||||
a *= b
|
a *= b
|
||||||
} -> std::same_as<rep&>;
|
} -> std::same_as<rep&>;
|
||||||
}
|
}
|
||||||
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_;
|
lhs.numerical_value_is_an_implementation_detail_ *= rhs.numerical_value_is_an_implementation_detail_;
|
||||||
return std::forward<Q1>(lhs);
|
return std::forward<Q1>(lhs);
|
||||||
@ -368,7 +368,7 @@ public:
|
|||||||
a /= b
|
a /= b
|
||||||
} -> std::same_as<rep&>;
|
} -> std::same_as<rep&>;
|
||||||
}
|
}
|
||||||
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<Value>::zero());
|
gsl_ExpectsAudit(v != quantity_values<Value>::zero());
|
||||||
lhs.numerical_value_is_an_implementation_detail_ /= v;
|
lhs.numerical_value_is_an_implementation_detail_ /= v;
|
||||||
@ -382,7 +382,7 @@ public:
|
|||||||
a /= b
|
a /= b
|
||||||
} -> std::same_as<rep&>;
|
} -> std::same_as<rep&>;
|
||||||
}
|
}
|
||||||
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());
|
gsl_ExpectsAudit(rhs != rhs.zero());
|
||||||
lhs.numerical_value_is_an_implementation_detail_ /= rhs.numerical_value_is_an_implementation_detail_;
|
lhs.numerical_value_is_an_implementation_detail_ /= rhs.numerical_value_is_an_implementation_detail_;
|
||||||
|
@ -223,7 +223,7 @@ public:
|
|||||||
|
|
||||||
// member unary operators
|
// member unary operators
|
||||||
template<typename QP>
|
template<typename QP>
|
||||||
friend constexpr decltype(auto) operator++(QP&& qp)
|
friend constexpr decltype(auto) operator++(QP && qp)
|
||||||
requires std::derived_from<std::remove_cvref_t<QP>, quantity_point> &&
|
requires std::derived_from<std::remove_cvref_t<QP>, quantity_point> &&
|
||||||
requires { ++qp.quantity_from_origin_is_an_implementation_detail_; }
|
requires { ++qp.quantity_from_origin_is_an_implementation_detail_; }
|
||||||
{
|
{
|
||||||
@ -238,7 +238,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename QP>
|
template<typename QP>
|
||||||
friend constexpr decltype(auto) operator--(QP&& qp)
|
friend constexpr decltype(auto) operator--(QP && qp)
|
||||||
requires std::derived_from<std::remove_cvref_t<QP>, quantity_point> &&
|
requires std::derived_from<std::remove_cvref_t<QP>, quantity_point> &&
|
||||||
requires { --qp.quantity_from_origin_is_an_implementation_detail_; }
|
requires { --qp.quantity_from_origin_is_an_implementation_detail_; }
|
||||||
{
|
{
|
||||||
@ -256,7 +256,7 @@ public:
|
|||||||
template<typename QP>
|
template<typename QP>
|
||||||
requires std::derived_from<std::remove_cvref_t<QP>, quantity_point> &&
|
requires std::derived_from<std::remove_cvref_t<QP>, quantity_point> &&
|
||||||
requires(quantity_type q) { quantity_from_origin_is_an_implementation_detail_ += q; }
|
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;
|
qp.quantity_from_origin_is_an_implementation_detail_ += q;
|
||||||
return std::forward<QP>(qp);
|
return std::forward<QP>(qp);
|
||||||
@ -265,7 +265,7 @@ public:
|
|||||||
template<typename QP>
|
template<typename QP>
|
||||||
requires std::derived_from<std::remove_cvref_t<QP>, quantity_point> &&
|
requires std::derived_from<std::remove_cvref_t<QP>, quantity_point> &&
|
||||||
requires(quantity_type q) { quantity_from_origin_is_an_implementation_detail_ -= q; }
|
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;
|
qp.quantity_from_origin_is_an_implementation_detail_ -= q;
|
||||||
return std::forward<QP>(qp);
|
return std::forward<QP>(qp);
|
||||||
|
Reference in New Issue
Block a user