[Rcpp-devel] variadic templates

Romain François francoisromain at free.fr
Tue Jan 5 13:49:29 CET 2010


On 01/05/2010 01:17 PM, Dirk Eddelbuettel wrote:
>
> On 5 January 2010 at 10:15, Romain François wrote:
> | We still need something to generate this line of the Makevars :
> |
> | PKG_CPPFLAGS += -I. -std=c++0x
> |
> | -std=c++0x is only valid from gcc 4.3, so people who want to build the
> | package but do not have access to gcc>= 4.3.O can just replace the line
> | with this :
> |
> | PKG_CPPFLAGS += -I.
>
> I can do that quite easily in configure; RQuantLib once needed tests to
> ensure that for g++ wasn't still 2.9*, and I also tests for QuantLib
> versions.  Just a matter a catching a string from g++ --version and
> comparing.  That will set the additional arg. for PKG_CPPFLAGS (actually: we
> should use PKG_CXXFLAGS for that) and define CXX0X as 1 (and maybe we flip
> the tests to  #if CXX0X  rathter than  #ifdef CXX0X)

There is no more CXX0X in the code. There is this instead:

#ifdef __GNUC__
	#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + 
__GNUC_PATCHLEVEL__)
	#if GCC_VERSION >= 40300
		#define HAS_VARIADIC_TEMPLATES
	#endif
	#if GCC_VERSION >= 40400
		#define HAS_INIT_LISTS
	#endif
#endif


The Makevars is the only thing left to change. You seem to know how to 
do it.

> | I've also added Rcpp::capabilities to query the capabilities of the
> | package.
> |
> | For example on my system I have :
> |
> | $ Rscript -e "Rcpp:::capabilities()"
> | variadic templates  initializer lists
> |                TRUE               TRUE
>
> Nice one!
>
> | I'll talk about what I want to do with initializer lists later.
>
> Ok.
>
> Dirk
>


-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- 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