In the lme4a package I mixed calls to Rf_error and throwing C++
exceptions.  This is causing problems and I plan to replace the calls
to Rf_error by exceptions so that there is a consistent approach.

Many of the calls to Rf_error take advantage of the fact the Rf_error
implicitly calls sprintf to create the error message.  Thus I have
calls like

        if (!d_x.size() == d_nrow * d_ncol)
            ::Rf_error("%s: Dim = (%d, %d) is inconsistent with x.size() = %d",
                       "ddenseMatrix::ddenseMatrix", d_nrow, d_ncol, 
d_x.size());

Is there a similar idiom for creating an exception's "what" argument?
I imagine I could add std::strings and maybe use some iostreams or
something like that ...
_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to