I’ve found an odd inconsistency between Rcpp which compiled with and without -std=c++0x.
Consider the expression
Function data_frame("data.frame");
GenericVector a;
a.push_back("17");
return data_frame(a, _["stringsAsFactors"]=0);
(ed. note: coercion to DataFrame in Rcpp actually thunks down to the R function, but doesn’t allow the user to set that flag.)
In “old” C++ (w/o -std=c++0x set) this code works. In modern C++ (w/ -std=c++0x set), this fails, saying “cannot coerce class “pairlist” into a data.frame”.
Obviously, this isn’t the end of the world: I just don’t use any newer features. However, I confess to being totally at a loss as to what causes this difference, and how to work around it without throwing C++11 away. Any ideas, anyone?
We love C++11 and cannot wait to use it. But we cannot use it in uploads to CRAN (as per a decree of the CRAN maintainers who consider C++11 “non portable” at this point — please complain to them, not us, of that irks you).
Consequently it is currently “barred”. There is a bit of detection in
RcppCommon.hand we defineHAS_CXX0X. But we haven’t really written code for this, as we can’t (yet) per the previous paragraph.So if you found a bug, please do us the favor and report it where request follow-ups to be sent: the
rcpp-devellist. Reproducible is good, patches even better 🙂