aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/unnamed_namespaces/ok/main.cpp
blob: c0c0664bdf457bfdc898357e2d49eb937a9c28a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "another.hpp"

#include <iostream>

namespace
{
    struct Test
    {
        Test() { std::cout << "main.cpp: Test::Test()\n"; }

        int x = 1;
    };
}

int main()
{
    Test test;
    std::cout << test.x << '\n';
    another();
    return 0;
}