std::shared_ptr<AbstractPrinter> parse_input_fiz(char const *input) {
std::shared_ptr<FizPrinter> printer(FizPrinter);
return printer;
}
FizPrinter inherited from AbstractPrinter. And i got next error:
Description Resource Path Location Type could not convert ‘printer’ from ‘std::shared_ptr (*)(FizPrinter)’ to ‘std::shared_ptr’ parser.cc /pdf-i/src line 63 C/C++ Problem
this function one of used in Factory
Did you mean
std::shared_ptr<FizPrinter> printer(new FizPrinter());
Your current code declares a function and the constructor for a shared_ptr
takes a pointer.