by rosshemsley · 9y ago · 0 comments
You should definitely understand it, but if you find yourself wanting to use it, you should start by considering alternatives first. It's a sharp (and often unsafe) tool that should be avoided in most cases.
For your example, unique_ptr is the correct (and safe) solution and will do the same thing.
> you don't need expensive atomics (shared_ptr)
Note that shared_ptr provides no "atomicity". It is in reality exceptionally cheap.
No comments yet.