This link explains very clearly why VC++ creates a temporary to initialize
the local reference, complete with a decision graph, and it seems that
the Rcpp expression template code should lead to the "create temporary"
branch: http://msdn.microsoft.com/en-us/library/szywdw8k.aspx
These comments com
Opps, I was too quick to declare victory here. That warning about
temporary reference initialization is not innocuous: crashes still
occur under VC++ (even with the updated RcppCommon.h) but
it is difficult to predict when they will occur. The Extractor.h
work-around fixes the problem for now.
The
To finish up this thread, it turns out that the VC++ problems did
help to reveal an architecture-dependent behavior of Rprintf
(under GCC) that
developers probably should be aware of, and it also points to
a potential problem with the way temporary references are
initialized in the expression templ
It appears that this is a matter of compiler interpretation of the C++
standards,
and it is not easy to see which compiler is correct (g++ or VC++).
When I disable the VC++ work-around I get the following warning from this
compiler about the Plus_Vector_Vector constructor:
c:\w\dev\stats\rbuild\R
Romain,
I found a work-around for the VC++ problem. All I have to do
is make sure the code that is currently ifdef-ed in Extractor.h
is NOT enabled under VC++ (when _MSC_VER is defined).
Currently this code is conditionally compiled with
#ifndef IF_GCC_450_OR_LATER, so the additional condition
tha
So that there is no confusion, I should add that the problems that I report
here do not occur under Linux/g++ or under MinGW/g++ (the supported
environments), where Rcpp/sugar seems to work fine.
On Sat, Jan 15, 2011 at 1:23 PM, Dominick Samperi wrote:
>
>
> On Sat, Jan 15, 2011 at 4:15 AM, Romai
On Sat, Jan 15, 2011 at 4:15 AM, Romain Francois
wrote:
> Le 13/01/11 16:29, Dominick Samperi a écrit :
>
> 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
Le 13/01/11 16:29, Dominick Samperi a écrit :
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
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 testsuga