> See also this answer:
> https://stackoverflow.com/a/48046118/1593077
> to the question of why C++ doesn't have a garbage collector.
The shared_ptr is an optional garbage collection based on reference counting. Slow, leaky, deterministic (that's an advantage and a disadvantage). C++ needs optional garbage collection if needs shared_ptr.