struct Data
{
explicit Data(const std::string type)
: m_type(type)
{
std::cout << "Data: " << m_type << std::endl;
}
~Data()
{
std::cout << "~Data: " << m_type << std::endl;
}
private:
std::string m_type;
};
Data global_data("global");
static Data global_static_data("global static");
void func()
{
static Data local_static_data("local static");
}
int main(int argc, char** argv)
{
std::cout << "main" << std::endl;
func();
func();
func();
Data local_data_1("local 1");
Data local_data_2("local 2");
std::cout << "main" << std::endl;
return EXIT_SUCCESS;
}