From ce8e9ba530e1c43342b21dcf300096b67ca9a8ea Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Mon, 29 May 2023 15:59:38 +0200 Subject: c++: change clang-fmt --- src/development/c++/.clang-format | 2 +- src/development/c++/meta2.cc | 12 +++++++++--- src/development/c++/meta4.cc | 4 +++- 3 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src/development/c++') diff --git a/src/development/c++/.clang-format b/src/development/c++/.clang-format index 3cfb373..1b5900c 100644 --- a/src/development/c++/.clang-format +++ b/src/development/c++/.clang-format @@ -18,7 +18,7 @@ AllowAllConstructorInitializersOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false -AllowShortFunctionsOnASingleLine: Inline +AllowShortFunctionsOnASingleLine: Empty AllowShortIfStatementsOnASingleLine: Never AllowShortLambdasOnASingleLine: All AllowShortLoopsOnASingleLine: false diff --git a/src/development/c++/meta2.cc b/src/development/c++/meta2.cc index 4c1194f..cd9c625 100644 --- a/src/development/c++/meta2.cc +++ b/src/development/c++/meta2.cc @@ -52,7 +52,9 @@ void Invoke(const Ctx& C, P... params) { // Custom context. struct Ctx { - void out(const char* s, unsigned v) const { printf("%s%x\n", s, v); } + void out(const char* s, unsigned v) const { + printf("%s%x\n", s, v); + } }; // Operations to invoke. @@ -63,7 +65,9 @@ struct OpA { using Return = int; static constexpr const char* const Name = "OpA"; - constexpr Return operator()(int a, int b) const { return a + b; } + constexpr Return operator()(int a, int b) const { + return a + b; + } }; template @@ -72,7 +76,9 @@ struct OpB { using Return = void; static constexpr const char* const Name = "OpB"; - Return operator()(const Ctx& C, unsigned a) const { C.out("a = ", a); } + Return operator()(const Ctx& C, unsigned a) const { + C.out("a = ", a); + } }; int main() { diff --git a/src/development/c++/meta4.cc b/src/development/c++/meta4.cc index 9c3be77..7437cb4 100644 --- a/src/development/c++/meta4.cc +++ b/src/development/c++/meta4.cc @@ -22,7 +22,9 @@ struct registry { return r.second; } - R invoke(const std::string& nm, P... p) const { return invoke_impl(nm, p...); } + R invoke(const std::string& nm, P... p) const { + return invoke_impl(nm, p...); + } void dump() const { for (const auto& it : m_fns) { -- cgit v1.2.3