Permalink
Browse files

Model class: explicitly std::enable_shared_from_this<Model>.

  • Loading branch information...
agarny committed Jul 20, 2018
1 parent e6e47a4 commit d2dfc7db9aac37eb80c7b8016646de0ba3a2a41d
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/model.cpp
View
@@ -59,7 +59,12 @@ std::vector<UnitsPtr>::iterator Model::ModelImpl::findUnits(const UnitsPtr &unit
}
Model::Model()
#ifndef SWIG
: std::enable_shared_from_this<Model>()
, mPimpl(new ModelImpl())
#else
: mPimpl(new ModelImpl())
#endif
{
}
@@ -70,13 +75,19 @@ Model::~Model()
Model::Model(const Model &rhs)
: ComponentEntity(rhs)
#ifndef SWIG
, std::enable_shared_from_this<Model>()
#endif
, mPimpl(new ModelImpl())
{
mPimpl->mUnits = rhs.mPimpl->mUnits;
}
Model::Model(Model &&rhs)
: ComponentEntity(std::move(rhs))
#ifndef SWIG
, std::enable_shared_from_this<Model>()
#endif
,mPimpl(rhs.mPimpl)
{
rhs.mPimpl = nullptr;

0 comments on commit d2dfc7d

Please sign in to comment.