Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Person {
- public:
- Person(int age) {
- age_ = age;
- }
- private:
- int age_;
- };
- class Life {
- public:
- Life(int age) {
- person_ = std::make_unique<Person>(age);
- }
- private:
- std::unique_ptr<Person> person_;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement