以下程序输出什么?
#include <iostream>
class ComponentA
{
public:
ComponentA()
{
std::cout << "a";
}
~ComponentA()
{
std::cout << "~a";
}
};
class ComponentB
{
public:
ComponentB()
{
std::cout << "b";
throw std::exception();
}
~ComponentB()
{
std::cout << "~b";
}
};
class ComponentC
{
public:
ComponentC()
{
std::cout << "c";
}
~ComponentC()
{
std::cout << "~c";
}
};
class Container
{
ComponentA m_a;
ComponentB m_b;
ComponentC m_c;
public:
Container()
{
std::cout << "d";
}
~Container()
{
std::cout << "~d";
}
};
int main()
{
try
{
Container c;
}
catch (std::exception const &)
{
}
return 0;
}