4 ms·
I started reading the link "bans everything to start with anyway" in the slides: https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/c++/c++-featu
by kwant_kiddo 4y ago
I started reading the link "bans everything to start with anyway" in the slides:
https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/c++/c++-features.md#modern-c_use-in-chromium https://chromium.googlesource.com/chromium/src/+/HEAD/styleg...
And I noticed the ban of shared_ptr and <chrono>.
I know the use of shard_ptr should be done cautiously, but just banning it from use? How do the Chromium devs solve a problem that requires shared ownership?
I guess you can come a long way with singletons and consumer/producer queues. But are raw-pointers just used instead of shared_ptr when shared ownership is needed?
Also banning use of <chrono> ?
Can someone try to explain the possible reasons?
- adzm 4y agoChromium has an existing ecosystem with a variety of smart pointers already.
- kwant_kiddo 4y agoyeah I found this when stumping upon https://source.chromium.org/chromium https://source.chromium.org/chromium I guess that makes sense as well.
- bialpio 4y agoAs for <chrono>, the link you provided also has a (short) justification behind the decision: https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/c++/c++-features.md#date-and-time-utilities-banned https://chromium.googlesource.com/chromium/src/+/HEAD/styleg... Regarding smart pointers, not sure if you also found this: https://chromium.googlesource.com/chromium/src/+/HEAD/base/memory/README.md https://chromium.googlesource.com/chromium/src/+/HEAD/base/m...
- GoblinSlayer 4y agoDid you see that <chrono>? C++ committee smoked something unspecified when they ratified <chrono>, but banning it is perfectly reasonable.