Skip to content
Snippets Groups Projects

Resolve "emplace: can it return derived class pointer?"

8 files
+ 41
22
Compare changes
  • Side-by-side
  • Inline
Files
8
@@ -107,7 +107,7 @@ class CaptureBase : public NodeBase, public std::enable_shared_from_this<Capture
void move(FrameBasePtr);
void link(FrameBasePtr);
template<typename classType, typename... T>
static std::shared_ptr<CaptureBase> emplace(FrameBasePtr _frm_ptr, T&&... all);
static std::shared_ptr<classType> emplace(FrameBasePtr _frm_ptr, T&&... all);
protected:
SizeEigen computeCalibSize() const;
@@ -130,9 +130,9 @@ class CaptureBase : public NodeBase, public std::enable_shared_from_this<Capture
namespace wolf{
template<typename classType, typename... T>
std::shared_ptr<CaptureBase> CaptureBase::emplace(FrameBasePtr _frm_ptr, T&&... all)
std::shared_ptr<classType> CaptureBase::emplace(FrameBasePtr _frm_ptr, T&&... all)
{
CaptureBasePtr cpt = std::make_shared<classType>(std::forward<T>(all)...);
std::shared_ptr<classType> cpt = std::make_shared<classType>(std::forward<T>(all)...);
cpt->link(_frm_ptr);
return cpt;
}
Loading