aboutsummaryrefslogtreecommitdiff
path: root/raii/constructor-hello-world.cpp
blob: c86e1ca7c6713785b2e74bf4fc18dbe2d84757c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>

class BadType {
public:
	BadType() {
		std::cout << "Variable created!" << std::endl;
	}

	~BadType() {
		std::cout << "Variable destroyed, bye bye" << std::endl;
	}
};

int main() {
	BadType x;
	return 0;
}

Generated with cgit - Back to sebastiano.tronto.net