[Rcpp-devel] variadic templates

Romain François francoisromain at free.fr
Sat Jan 2 21:45:51 CET 2010


they are really nice. they provide some sort of ellipsis in the template 

unfortunately, they are not part of the current standard, but in the 
forthcoming new standard c++0x. See 

But, gcc has many of c++0x features covered. 

Why should we are about them. For example we want to mimic making this 

 > call( "rnorm", 10L, 0.0, 2.0 )
rnorm(10L, 0, 2)

in C++, we (as soon as I can commit it) have the Language class, and I'd 
like calling it something like :

Language obj( "rnorm", 10, 0.0, 2.0 ) ;

The wrap functions provide conversion of each element to a SEXP, and 
variadic templates would take care of the rest.

This needs this in the Makevars :

PKG_CPPFLAGS += -I. -std=c++0x

and presumably also in RcppCxxFlags

This is available as of GCC 4.3, so I guess we could #ifdef this somehow ?

Ideas ?


Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
|- http://tr.im/IW9B : C++ exceptions at the R level
|- http://tr.im/IlMh : CPP package: exposing C++ objects
`- http://tr.im/HlX9 : new package : bibtex

More information about the Rcpp-devel mailing list