It appears that Rcpp's List::operator=
is broken. With this code:
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
void Test(){
List L;
List L1=List::create(12,45,22,44);
SEXP x=Language("c",L,L1).eval();//update, add L1's elements on L's back.
Rprintf( "x = " ) ; Rf_PrintValue(x) ; Rprintf( "\n") ;
L = x;
Rprintf( "L = " ) ; Rf_PrintValue(L) ; Rprintf( "\n") ;
}
I get this with the current devel version of Rcpp.
> Test()
x = [[1]]
[1] 12
[[2]]
[1] 45
[[3]]
[1] 22
[[4]]
[1] 44
L = list()
which is wrong. However, I get something correct with Rcpp11:
> Test()
x = [[1]]
[1] 12
[[2]]
[1] 45
[[3]]
[1] 22
[[4]]
[1] 44
L = [[1]]
[1] 12
[[2]]
[1] 45
[[3]]
[1] 22
[[4]]
[1] 44