You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The result class implemented in the pimpl idiom is exported as ValueType with the CS_VALUE_TYPE macro, as shown below.
class LIB_EXPORT CS_VALUE_TYPE result {
class handle;
private:
handle *_pimpl;
public:
bool is_ok() const;
}
class LIB_EXPORT lib {
public:
result initialize();
}
Then, when there is an initialize() function that returns this result class, the output C# code is as follows.
public global::Result Initialize()
{
var ___ret = new global::Result.__Internal();
__Internal.Initialize(__Instance, new IntPtr(&___ret));
var _____ret = global::Result.__CreateInstance(___ret);
global::Result.__Internal.dtor(new __IntPtr(&___ret));
return _____ret;
}
Since the result class is implemented in the pimpl idiom, calling the destructor at global::Result.__Internal.dtor(new __IntPtr(&___ret)); will disable the __pimpl members on the c++ side.
This situation requires an option to suppress destructor calls.
The text was updated successfully, but these errors were encountered:
Brief Description
The result class implemented in the pimpl idiom is exported as ValueType with the CS_VALUE_TYPE macro, as shown below.
Then, when there is an initialize() function that returns this result class, the output C# code is as follows.
Since the result class is implemented in the pimpl idiom, calling the destructor at
global::Result.__Internal.dtor(new __IntPtr(&___ret));
will disable the __pimpl members on the c++ side.This situation requires an option to suppress destructor calls.
The text was updated successfully, but these errors were encountered: