-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
fix #968 with a single argument XPtr constructor #1003
Conversation
Somewhat semi-seriously, opening a new pull request is worse than cleaning the previous one (as it leads to issue inflation). All you needed was one |
Roger that, apologies that you had to be the one to suffer my first PR in a long time. |
No worries, after all it is you has to spend the rest of your life with the shame of a close Rcpp pull request ;-) And thanks again for the fix. I am running reverse-depends on a seriously underpowered machine (but hey, free courtesy access on another continent so cannot really complain and am in fact rather grateful for having it) so it will be a few hours but zero issues through sixty packages so far. |
@artemklevtsov Do you want to send me (or include here) a two-line diff? |
# inst/unitTests/cpp/XPtr.cpp
+ return wrap(p) == (p).tag();
- return wrap(p) == R_ExternalPtrTag(p); But I agree that |
Sorry, when I say |
@stephematician Slight trouble. On win-builder and with the older compiler I get
and we have so far resisted the siren song of turning C++11 on in Rcpp itself. Maybe we should condition part of this and/or keep the older version around? |
Which is what I just did and will test. Your new change will be in effect if and only if we have C++11 or better (i.e. almost everywhere) and I stuck the previous |
small updates incl hide away parts of #1003 if C++11 not available
Ah - right delegating constructors. Apologies for my slow response. We could move the work that the (delegating) constructor was doing into a private member, and call that in the body of both |
Oh, didn't think of that trick. Could do; or else we keep it simple and leave it as is ... |
Cleaned up pull request 1002
as<> will no longer modify tags/protected data of an existing external pointer. Modifying the tags/protected data of an external pointer via the XPtr(SEXP,SEXP,SEXP) constructor is made more explicit by removing the two default arguments, and XPtr(SEXP) is implemented separately (as explicit) and does not modify the external pointer's tags/protected data.
Added a self-tag test which passed here. I was unable to test if downstream packages are affected by this change.