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?

2 Answers
2

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.h and we define HAS_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-devel list. Reproducible is good, patches even better :)

Code targetting features of the new standard was written in Rcpp about 2 years ago.

But then, later we realized that CRAN did not accept the -std=c++0x flag for gcc (or equivalent flags for other compilers), and forcing the C++99 standard and therefore we cannot realistically use it.

Consequently we pretty much don't maintain the C++11 aware code. That's a shame because we'd really like to, but we prefer the exposure of being accepted in CRAN. Since we don't maintain, there are probably many things that don't work as they should.

This particular issue is probably easy to fix. And this will happen as soon as we get the green light on using C++11.

From Writing R extensions: "Although there is now a 2011 version of the C++ standard, it is not yet implemented (nor is it likely to be widely available for some years) and portable C++ code needs to follow the 1998 standard (and not use features from C99)."
–
Romain FrancoisNov 15 '12 at 11:04