Почему деструктор был вызван только один раз?

#include <iostream>

using namespace std;

class Test
{
public:
    Test()
    {   
        printf("construct ..\n");
    }   

    ~Test()
    {   
        printf("destruct...\n");
    }   
};

Test Get()
{
    Test t = Test();
    return t;
}

int main(int argc, char *argv[])
{
    Test t = Get();
    return 0;
}

вывод консоли:

$ g++ -g -Wall -O0 testdestructor.cc
$ ./a.out 

construct ..

destruct ...

9
задан Kjuly 19 October 2012 в 06:02
поделиться