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