-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Enable unique_ptr holder with mixed Deleters between base and derived types #1353
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
Conversation
LGTM. As I mentioned in #1317, this better matches the intentions of the check (which is really just meant to keep you from accidentally mixing |
One potential concern: What happens when you have a non-empty deleter that actually changes the memory layout of (It also seems like your holder could get misinterpreted, e.g. between |
I don't think it's a problem since |
I'm not sure if I completely understand; can I ask which casting you're referring to, specifically between (Asking in the context of #1237 where, at PR's present state, |
Just did a quick test on this branch: Takeaways:
The above caveat seems like a rare edge case, and would seem like a general design mistake, so I think this PR is fine as-is; could be addressed at a later point, perhaps with #1161. |
Rebased on master. Any idea why a single configuration is failing for xcode? |
+1 for this PR. What else needs to be done before it can be merged? I'de be happy to help if possible. |
-Recognize "std::unique_ptr<T, D>" as a default holder even if "D" doesn't match between base and derived holders
anything in particular holding back this PR? happy to help if there are any requests. |
It looks good to me. The reason for the delay is my (very) limited time budget for maintaining this project. |
Recognize "std::unique_ptr<T, D>" as a default holder even if "D" doesn't match between base and derived types. Currently, if "D" doesn't match you get a "type does not have a non-default holder type while its base does" error.
Reference this issue: #1317
And this solution: #1317 (comment)
An example where this will remove some boilerplate code is described here.