aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/development/c++/.clang-format2
-rw-r--r--src/development/c++/meta2.cc12
-rw-r--r--src/development/c++/meta4.cc4
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) {