diff options
Diffstat (limited to 'src/development/c++/meta2.cc')
-rw-r--r-- | src/development/c++/meta2.cc | 12 |
1 files changed, 9 insertions, 3 deletions
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() { |