一、整体代码
01.cpp
#includeusing namespace std; class Furniture { public: Furniture(int weight) : weight_(weight) { cout<<"Furniture ..."<
二、结果如下:
Furniture ...
Bed ...
Sofa ...
SofaBed ...
FoldIn ...
Watch TV ...
FoldOut ...
Sleep ...
~SofaBed ...
~Sofa ...
~Bed ...
~Furniture ...