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