Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Object
- {
- Object(const Object&) = delete;
- Object(Object&&);
- Object& operator=(const Object&) = delete;
- Object& operator=(Object&&);
- [...]
- };
- std::vector<Object> container;
- container.reserve(42) // Reserve a lot in order to be sure it won't be a problem
- container.emplace_back(1);
- container.emplace_back(3);
- auto it = container.end();
- it--; // Last position.
- it--; // Before last position.
- container.emplace(it, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement