This is with XCode C++ language dialect c++1y. Help me understand unique_ptr:
//1
auto ouput2 = make_unique<standard::Algorithm>(AlgorithmFactory::create("YamlOutput",
"filename", outputFilename));
//2
unique_ptr<standard::Algorithm> output(standard::AlgorithmFactory::create("YamlOutput",
"filename", outputFilename));
1 fails with build with "Semantic Issue: Allocating an object of abstract class type 'essentia::standard::Algorithm", but 2 succeeds.
I read that these two are equivalent, so how come one succeeds and the other doesn't?
I look at the source for AlgorithmFactory::create() it returns a BaseAlgorithm* depending on the string input. Not really understanding the object hierarchy since standard::Algorithm doesn't seem to have anything to do with BaseAlgorithm (it doesn't extend it).
This is how the documentation for the Essentia library I am using did it except they were using a naked pointer.