Popularized articles about C++ are very hit or miss. It’s partly because the language is so hit and miss in it’s non-design.
The most glaring error in the iceberg IMO is the claim that shared_ptr is an antipattern.
Shared_ptr is brilliant for immutable data in parallel programs. It’s not an antipattern. It’s useless for sure as a building block for data structures and other linked data with potential for circular references.
But really, if a resource is a) immutable and b) needed in a shared context then a thin wrapper around a map of shared pointers or such saves the pain of needing to implement a much more complex resource management scheme.
The most glaring error in the iceberg IMO is the claim that shared_ptr is an antipattern.
Shared_ptr is brilliant for immutable data in parallel programs. It’s not an antipattern. It’s useless for sure as a building block for data structures and other linked data with potential for circular references.
But really, if a resource is a) immutable and b) needed in a shared context then a thin wrapper around a map of shared pointers or such saves the pain of needing to implement a much more complex resource management scheme.