3,973 questions
extern "C" + std::unique_ptr
Flaviu_
1,031
Reputation points
Is there possible to return from a DLL a unique pointer ? I have tried this:
extern "C" __declspec(dllexport) std::unique_ptr<int*> __cdecl SomeMethod(const char* type)
{
return nullptr;
}
and I got:
error C2526: 'SomeMethod': C linkage function cannot return C++ class 'std::unique_ptr<int *,std::default_delete<_Ty>>'
I wonder whether is possible that. Is it ?
Of course, in the real code is another object type than int*
Developer technologies | C++
Sign in to answer