Related to this SO post:
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
List test_list(SEXP x){
List L;
L = x;
return L;
}
/*** R
test_list( list(1, 2, 3) )
*/
just gives
> test_list( list(1, 2, 3) )
list()
This is because of the odd comma-initialization operator=, in Vector.h:
internal::ListInitialization<iterator,init_type> operator=( init_type x){
iterator start = begin() ; *start = x;
return internal::ListInitialization<iterator,init_type>( start + 1 ) ; ;
}
This hijacks the normal operator= and breaks things here.
Related to this SO post:
just gives
This is because of the odd comma-initialization
operator=, inVector.h:This hijacks the normal
operator=and breaks things here.