So I was reading some Stack Overflow answers about deleting pointer arguments particularly these ones(1,2), because I am building a function, that requires a pointer as an argument.
A simplified version of the function is below:
void draw(Shape * b)
Shape * c;
You might use
void draw(std::observer_ptr<Shape> shape)
void draw(Shape& shape)
void draw(Shape * shape)
To be explicit that
draw doesn't reclaim ownership.
and use smart pointer in signature when you reclaim it.
void Take(std::unique_ptr<Shape> shape);
void Take(std::shared_ptr<Shape> shape);