[Rcpp-devel] assert() for Rcpp?
rsparapa at mcw.edu
Wed Feb 18 17:08:07 CET 2015
On Tue, 2015-02-17 at 17:53 -0700, JJ Allaire wrote:
> One piece of immediate feedback on your initial implementation: you
> can't call Rf_error from C++ code (as it will bypass C++ destructors
> on the stack). Rather, you should throw Rcpp::exception.
Ok, this puzzles me. We can't call Rf_error from C++ code, but we can
call it from within the exception handler, right? It would seem so
since Dirk has written a nice gallery post that does it that way...
Just my $0.02, but I would stick to exceptions and avoid assert in C++.
More information about the Rcpp-devel