main.cpp 408 B

12345678910111213141516171819202122
  1. #include "trait.h"
  2. #include "circle.h"
  3. #include "rectangle.h"
  4. #include "circle_shape.h"
  5. #include "rectangle_shape.h"
  6. #include "shape.h"
  7. #include <vector>
  8. using namespace std;
  9. int main()
  10. {
  11. vector<Shape> geometries;
  12. geometries.emplace_back(Circle());
  13. geometries.emplace_back(Rectangle());
  14. for (const auto &shape : geometries)
  15. {
  16. cout << shape.area() << endl;
  17. }
  18. return 0;
  19. }