The template expression code is very interesting, but it does not work as expected under Windows/g++/MinGW/32bit/Rterm.exe. The problem does not appear when I use Rgui.exe, or if I use 64bit Windows!
Consider the following C++ code called using .Call('testsugar',1:5,1:5): RcppExport SEXP testsugar(SEXP x_, SEXP y_) { Rcpp::NumericVector x(x_), y(y_); Rprintf("%d, %lf, %lf\n", (x+y).size(), (x+y)[0], (x+y)[1]); return R_NilValue; } Under Linux/GCC, or 64bit Windows/g++, or 32bit Windows/g++ I get the expected result: 5, 2.0, 4.0 Under Windows/32bit/Rterm.exe I get: 5, 0.0, 0.0 (Under VC++ there are more serious problems including corruption of other in the wrap-up function Vector(VectorBase& other), but since VC++ is not supported I will not elaborate here.) Thanks, Dominick
_______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel