We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I saw this mentioned here before, but there seems to be no recommended way of handling virtual destructors. I.e.:
struct SomeStruct { static std::unique_ptr<SomeStruct> open(const char* filePath); protected: virtual ~SomeStruct() {} }
The error output looks something like this:
... warning: /usr/include/c++/7/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = SomeStruct]’: warning: /usr/include/c++/7/bits/unique_ptr.h:263:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = SomeStruct; _Dp = std::default_delete<SomeStruct>]’ warning: .../cxxbridge.rs.cc:101:34: required from here warning: /usr/include/c++/7/bits/unique_ptr.h:78:2: error: ‘virtual SomeStruct::~SomeStruct()’ is protected within this context warning: delete __ptr; warning: ^~~~~~ warning: In file included from .../wrapper.hpp:2:0, warning: from .../cxxbridge.rs.cc:1: warning: something.hpp:40:17: note: declared protected here warning: virtual ~SomeStruct(); warning: ^
The text was updated successfully, but these errors were encountered:
I suppose you have to wrap everything that is not directly supported by cxx?
Sorry, something went wrong.
No branches or pull requests
I saw this mentioned here before, but there seems to be no recommended way of handling virtual destructors. I.e.:
The error output looks something like this:
The text was updated successfully, but these errors were encountered: