23種設計模式之裝飾器模式(結構型,2 Decorator,c++實現)

代碼實現: #include <iostream> using namespace std; class Car { public: virtual void show() = 0; }; class RunCar :public Car { public: void show() { cout << "run" << endl; } }; class SwimCarDirector :publi
相關文章
相關標籤/搜索