-
Notifications
You must be signed in to change notification settings - Fork 2
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
cpp: define isl::managed_copy() overload #9
Comments
While the idea of the C++ interface is not to use raw pointers, other isl-dependent libraries (read ppcg) may use raw pointers and feature no C++ interface. |
Sounds very reasonable. Should be a rather simple change and this is indeed a pattern that arises often. Would be glad to see a PR. |
This hack may work, but it will break the consistency of __isl_keep/__isl_take because manage is __take. template <typename T>
auto managed_copy(__isl_keep T t) -> decltype(isl::manage(t)) {
auto x = isl::manage(t);
auto copy = x;
x.release();
return copy;
} |
I would just extend the generator. Should only be a couple of lines and Best, |
This issue has been resolved. |
I found myself writing
isl::manage(isl_whatever_copy(o)); // manage releases!
multiple times.
Can we generate an overloaded function
as a shortcut for these cases?
The text was updated successfully, but these errors were encountered: