aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/_posts/snippets/static_vs_inline_vs_unnamed_namespaces/unnamed_namespaces/ok/main.cpp
blob: e383ded560097969435c5ba1948ec1ece82d3ef2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#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;
}