I had a question. I am working with external library in C++. The factory returns the unique pointer of the object. E.g. there is shapefactory which gives different shape different with different arguments
static std::unique_ptr<Shape> CreateShape(const std::string & );
I wanted to understand two things.
First why the factory returns static unique pointer ? What are the advantages and disadvantages of returning static V/s non static
If I am designing factory, when to return unique pointer V/s shared pointer ?