Advertisement
Guest User

Untitled

a guest
Sep 17th, 2020
679
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <memory>
  4.  
  5. struct Car {
  6. };
  7.  
  8. using std::vector;
  9. using std::shared_ptr;
  10. using std::make_shared;
  11.  
  12. int main()
  13. {
  14.     int length = 3;
  15.     auto cars = make_shared<vector<shared_ptr<Car>>>();
  16.     for (int i = 0; i < length; i++) {
  17.         cars->push_back(make_shared<Car>());
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement