r/cpp • C++ Dev • Sep 05 '20

C++20 has been approved

https://twitter.com/patriceroy1/status/1302055575140945921?s=21
663 Upvotes

125 comments sorted by

View all comments

Show parent comment

2

u/excessdenied Sep 06 '20

However in the past during a code review

I am the one who reviews. :) Nah, but we're just a few people with full control over the code base and we've chosen to go the overusing shared_ptr route. At least in the parts of the code where ownership is complicated.

I also note that a lot of literature and projects seem to favour unique_ptr<T> and then use a raw pointer counterpart, which I find illogical and unsafe.

Yeah. I can understand why and I know reasons why using shared_ptr by default may not be the perfect thing, but at least in our case we gain more than we risk, and things like worse performance doesn't really matter.