12345678910111213141516171819202122 |
- #include "trait.h"
- #include "circle.h"
- #include "rectangle.h"
- #include "circle_shape.h"
- #include "rectangle_shape.h"
- #include "shape.h"
- #include <vector>
- using namespace std;
- int main()
- {
- vector<Shape> geometries;
- geometries.emplace_back(Circle());
- geometries.emplace_back(Rectangle());
- for (const auto &shape : geometries)
- {
- cout << shape.area() << endl;
- }
- return 0;
- }
|