原因:
contains a std::unique_ptr.
A std::unique_ptr cannot be copied
or
contains a std::shared_ptr
A std::unique_ptr cannot be copied
解决方法:
传入:
//cpp1
class B{
A::getPTR(target_ptr)
}
//cpp2
class A{
getPTR(const B& target_ptr)
{
std::shared_ptr<B> copied_ptr = std::make_shared<B>(target_ptr);
}
}
target_ptr : is the ptr you wanna copy
copied_ptr : is the ptr you copied