-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Not possible to return unique pointer to pure virtual class #641
New issue
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
Comments
Having the same problem. I tried to use this to solve the issue, but it doesn't. |
Is this with current master? I can't reproduce it (but I can with the commit just before PR #607 was merged). |
I merged the PR in seperate branch as it was not yet in master, but that didn't solve it. I just tried to use my fork with the current master 20170204, but now I am getting seg fault ... Digging further. |
Yes, I saw that too; it happens during destruction of the instance returned via the shared_ptr. (I didn't dig into why it's happening.) |
I did a clean build of my project against my fork of the current master, and it seems to work. I'll have a further look tommorrow. |
Updating to the latest master solved the issue. Feel free to close. |
yep, i have been running various tests, it works. thanks. |
If I try to return a unique pointer to a pure virtual class it fails due to
However it if the class is not pure virtual it works fine. Same for returning a shared pointer to it.
Below is a minimal working example based on the docs
Output:
The text was updated successfully, but these errors were encountered: