R . , Windows 7 x64, R 3.1.1 Rtools 3.1.0.1942. gcc :
R 3.1.1 (2014-07-10) Rcpp 0.11.2. rgui.exe, IDE, RStudio, - .
, system('gcc -v') R, :
COLLECT_GCC=F:\Rtools\MINGW-~1\X64-48~1.1-P\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=f:/rtools/mingw-~1/x64-48~1.1-p/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.8.1/lto-wrapper.exe
Target: x86_64-w64-mingw32
[Edited Config info]
Thread model: posix
gcc version 4.8.1 (rev5, Built by MinGW-W64 project)
, gcc 4.6.3 to 4.8.0, , C++11, gcc 4.8.*, R, Rcpp::sourceCpp , .cpp , ( gcc 4.6.3):
#include <Rcpp.h>
template<typename T>
struct Wrap
{
int test2(int depth)
{
m_test++;
std::vector<int> v = { 0, 1, 2, 3 };
return depth == 0? 1 : std::accumulate(
v.begin(), v.end(), int(0), [=](int sub, int const&) {
return sub + test2(depth - 1);
});
}
int m_test = 0;
};
struct X
{
template <class T> static void bar() {}
template <class T> void foo(T p)
{
[&] { bar<T>(); };
}
};
double inheriting(int in_){
struct A {
A(int u){
hello = u*u/2.0;
};
double hello;
};
struct B: A { using A::A; };
B b(in_);
return(b.hello);
}
void test_lambda(int in_)
{
X x;
x.foo(in_);
}
int test_bug_4_7_2(int in_){
Wrap<int> w;
return w.test2(in_);
}