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

Improve exception safety with smart pointers #129

Open
elfring opened this issue Aug 15, 2018 · 2 comments
Open

Improve exception safety with smart pointers #129

elfring opened this issue Aug 15, 2018 · 2 comments

Comments

@elfring
Copy link

elfring commented Aug 15, 2018

Would you like to wrap any pointer data members with the class template “std::unique_ptr”?

@rserban
Copy link
Member

rserban commented Aug 18, 2018

I assume you are talking about private data members in which case I am not so sure it is worth using unique_ptr. For data members that are made public (e.g., through accessors), it's almost always the case that a shared_ptr is needed (unless you found a case where that's not true?). Having said that, there are still places in Chrono where raw pointers are exposed to the user -- we fix these as we go along whenever we find the time.

@elfring
Copy link
Author

elfring commented Aug 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants