You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cleanup __cplusplus checks based on C++11 availability #1370
remains. We could remove the second branch as part of #1371, but I think that it would probably be better to remove the first branch, because I don't see how this is needed just here, and then a future improvement could be to reimplement ::Rcpp::traits::result_of using std stuff. It seems it is needed for lambdas, see #213. Then mapply and other functions won't work with lambdas either. So probably a separate issue dedicated to reimplementing result_of is indeed required.
I think this #else is harmless and opted to keep it. If we decide to remove it I think we can/should also look into removing it definition -- ie ::Rcpp::traits::result_of<Function>::type.
I pushed a branch feature/result_of_function that rewrites result_of to generalize the fix proposed for sapply, so that also lapply, mapply and outer can work with lambdas. What do you think?
Activity
Enchufa2 commentedon Mar 24, 2025
What to do with
Rcpp/inst/include/Rcpp/sugar/functions/sapply.h
Lines 33 to 45 in 30edbf5
remains. We could remove the second branch as part of #1371,
but I think that it would probably be better to remove the first branch, because I don't see how this is needed just here, and then a future improvement could be to reimplementIt seems it is needed for lambdas, see #213. Then mapply and other functions won't work with lambdas either. So probably a separate issue dedicated to reimplementing::Rcpp::traits::result_ofusingstdstuff.result_ofis indeed required.eddelbuettel commentedon Mar 24, 2025
I think this
#elseis harmless and opted to keep it. If we decide to remove it I think we can/should also look into removing it definition -- ie::Rcpp::traits::result_of<Function>::type.Enchufa2 commentedon Mar 24, 2025
I pushed a branch
feature/result_of_functionthat rewritesresult_ofto generalize the fix proposed forsapply, so that alsolapply,mapplyandoutercan work with lambdas. What do you think?eddelbuettel commentedon Mar 24, 2025
That sounds like a good way forward.
Enchufa2 commentedon Mar 24, 2025
Ok, then I'll rebase it when the current PR is merged, add more tests with lambdas, etc., and open a new PR for this.
eddelbuettel commentedon Mar 24, 2025
That sounds even better!