diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2023-05-29 15:59:38 +0200 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2023-05-29 15:59:38 +0200 |
commit | ce8e9ba530e1c43342b21dcf300096b67ca9a8ea (patch) | |
tree | 322c4de4bd0fff1cc0628c75a110e5ea08530854 | |
parent | 08f554df4ee9a68a0e4694ba9930561ecc196ecd (diff) | |
download | notes-ce8e9ba530e1c43342b21dcf300096b67ca9a8ea.tar.gz notes-ce8e9ba530e1c43342b21dcf300096b67ca9a8ea.zip |
c++: change clang-fmt
-rw-r--r-- | src/development/c++/.clang-format | 2 | ||||
-rw-r--r-- | src/development/c++/meta2.cc | 12 | ||||
-rw-r--r-- | src/development/c++/meta4.cc | 4 |
3 files changed, 13 insertions, 5 deletions
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<typename Ctx> @@ -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<R>(nm, p...); } + R invoke(const std::string& nm, P... p) const { + return invoke_impl<R>(nm, p...); + } void dump() const { for (const auto& it : m_fns) { |