emplace: can it return derived class pointer?
Can we return the derived pointer so that the following code can be written in one line?
// wolf: emplace
auto c = FactorBase::emplace<FactorDiffDrive>(f1, f1, C0, processor);
FactorDiffDrivePtr cd = std::static_pointer_cast<FactorDiffDrive>(c);
// would be written as
FactorDiffDrivePtr cd = FactorBase::emplace<FactorDiffDrive>(f1, f1, C0, processor);
// this would also work out of the box:
FactorBasePtr cb = FactorBase::emplace<FactorDiffDrive>(f1, f1, C0, processor);
Edited by Joan Solà Ortega