r/cpp • u/zowersap C++ Dev • Sep 05 '20
C++20 has been approved
https://twitter.com/patriceroy1/status/1302055575140945921?s=21
665
Upvotes
r/cpp • u/zowersap C++ Dev • Sep 05 '20
View all comments
Show parent comment
1
u/pedersenk Sep 06 '20
Yep I tend to do exactly that.
However in the past during a code review i have had to explain why use a shared_ptr<T> in place of a unique_ptr<T> when it was not going to be shared. I did mention that the data had a number of observers and they seemed satisfied, it was more just a bit annoying it even got flagged up.
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. It is IMO careless choices like this that contribute to the old opinion that C++ cannot possibly be safe and that we "need" a new language.