Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add concept ex for smart pointers #846

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vaeng
Copy link
Contributor

@vaeng vaeng commented Mar 21, 2024

No description provided.

@vaeng vaeng added x:action/create Work on something from scratch x:module/concept-exercise Work on Concept Exercises x:size/large Large amount of work labels Mar 21, 2024
Copy link
Contributor Author

@vaeng vaeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This exercise story is made up from scratch. I hope it is interesting enough and not too convoluted.

Using `std::make_shared()` promotes cleaner, safer, and more efficient code when working with `std::shared_ptr` objects in C++.


~~~~exercism/advanced
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I take this out, even though it is in the connected concept?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are students required to use std::weak_ptr it in the exercise? If not, I'd omit it.

Using `std::make_shared()` promotes cleaner, safer, and more efficient code when working with `std::shared_ptr` objects in C++.


~~~~exercism/advanced
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are students required to use std::weak_ptr it in the exercise? If not, I'd omit it.

Comment on lines +3 to +4
Smart pointers are a modern C++ feature designed to provide automatic memory management, helping to prevent memory leaks and dangling pointers commonly associated with raw pointers.
They act as wrappers around raw pointers, adding additional functionality such as automatic memory deallocation when the pointer is no longer needed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is well written summary!


## Unique Pointers


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:action/create Work on something from scratch x:module/concept-exercise Work on Concept Exercises x:size/large Large amount of work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants