diff options
Diffstat (limited to '_posts/snippets/static_vs_inline_vs_unnamed_namespaces/static')
3 files changed, 3 insertions, 6 deletions
diff --git a/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/static/main.cpp b/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/static/main.cpp index 7fbeb56..fde1a43 100644 --- a/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/static/main.cpp +++ b/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/static/main.cpp @@ -3,8 +3,7 @@ #include <iostream> -int main() -{ +int main() { std::cout << shared() << '\n'; std::cout << proxy() << '\n'; return 0; diff --git a/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/static/proxy.cpp b/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/static/proxy.cpp index a8eef26..78e4611 100644 --- a/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/static/proxy.cpp +++ b/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/static/proxy.cpp @@ -1,7 +1,6 @@ #include "proxy.hpp" #include "shared.hpp" -int proxy() -{ +int proxy() { return shared(); } diff --git a/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/static/shared.hpp b/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/static/shared.hpp index 6f812ab..647f49e 100644 --- a/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/static/shared.hpp +++ b/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/static/shared.hpp @@ -1,7 +1,6 @@ #pragma once -static int shared() -{ +static int shared() { static int n = 0; return ++n; } |