aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/unnamed_namespaces/ok/another.cpp
diff options
context:
space:
mode:
Diffstat (limited to '_posts/snippets/static_vs_inline_vs_unnamed_namespaces/unnamed_namespaces/ok/another.cpp')
-rw-r--r--_posts/snippets/static_vs_inline_vs_unnamed_namespaces/unnamed_namespaces/ok/another.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/unnamed_namespaces/ok/another.cpp b/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/unnamed_namespaces/ok/another.cpp
new file mode 100644
index 0000000..10128ef
--- /dev/null
+++ b/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/unnamed_namespaces/ok/another.cpp
@@ -0,0 +1,18 @@
+#include "another.hpp"
+
+#include <iostream>
+
+namespace
+{
+ struct Test
+ {
+ Test() { std::cout << "another.cpp: Test::Test()\n"; }
+
+ float y = 1.;
+ };
+}
+
+void another()
+{
+ Test test;
+}