Reason:
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
Solutions:
To:
//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 want to copy.
Copied ptr: is the ptr you copied
Read More:
- QT solves error: use of deleted function and is private within this context
- [Solved] NDK JNI DETECTED ERROR IN APPLICATION: use of deleted local reference
- [Solved] Error: error C2601: ‘b‘ : local function definitions are illegal error C2063: ‘b‘ : not a function
- Linux C++ Error: invalid use of incomplete type [How to Solve]
- Taro Use React Hooks Error: TypeError: Object(…) is not a function
- [How to Fix]Type error: must use keyword argument for key function
- Type error: must use keyword argument for key function
- R language Use setwd() function Error [How to Solve]
- [Solved] Error ‘false‘ undeclared (first use in this function)
- [Solved] igb Compile Error: igb_main.c:10044:7: error: implicit declaration of function ‘isdigit’
- [Solved] Error C1189: #error: Please use the /MD switch for _AFXDLL builds
- Visual Studio 2012 error C4996: ‘scanf’: This function or variable may be unsafe.
- [Solved] error C4996: ‘QWheelEvent::pos‘: Use position()
- github Error: Logon failed, use ctrl+c to cancel basic credential prompt.
- Function declare Error: Error C231: ‘delay300us’: redefinition
- [Solved] Vscode Katex Error: ParseError: KaTeX Parse Error: Can‘t Use Function ‘$‘ In Math Mode At Position …
- React Hook “useState“ is called in function “xxx“ which is neither a React function component or
- [Solved] Tensorflow2.0 Error: Function call stack:distributed_function
- Grpc Compilation issues: “C++ versions less than C++11 are not supported.
- How to Solve Fatal error stdatomic in C/C++ Compilation