Guess the output for C++11?
Usually destructor will be called immediately for temporary objects soon after the construction.
As said above, destructor for following declaration method will be called immediately
But In the following objects creation method, even though temporary objects is used to create objects, destructor will not be called immediately. This is because of move semantics concept in c++. Temporary objects created will be moved instead of copying and destroying the temporary object.