Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <memory>
- struct Car {
- };
- using std::vector;
- using std::shared_ptr;
- using std::make_shared;
- int main()
- {
- int length = 3;
- auto cars = make_shared<vector<shared_ptr<Car>>>();
- for (int i = 0; i < length; i++) {
- cars->push_back(make_shared<Car>());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement