On Sat, Feb 08, 2020 at 03:28:22PM -0500, JJ Allaire wrote: > Agreed that it would be good to have more clear docs here. Note > that as Dirk pointed out both Writing R Extensions and > RcppParallel docs are pretty clear about the fact that you > shouldn't call any R APIs when in a background thread.
Rcpp::stop superficially looks like a nice way to throw C++ exceptions that also does printf style message formatting. I didn't realize that it calls R APIs until I looked at the implementation. > I think the point is that the *only* reason Rcpp::stop exists is > to do forwarding to Rf_error. If that isn't your intention it's > strictly worse than a normal C++ exception. Sure, but does it *have* to be that way? It seems to me that exceptions.h line 40, rcpp_set_stack_trace(Shield<SEXP>(stack_trace())) could just as easily be done around macros/macros.h line 51. _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel