[Rcpp-devel] Traits for NA?

Kirill Müller kirill.mueller at ivt.baug.ethz.ch
Tue Apr 9 09:51:26 CEST 2013


Hi

What is the best way to determine the NA value for a specific type given 
the type identifier (as returned by TYPEOF()), preferably as a 
compile-time constant?

I'm looking for something along the following lines:

static_assert(NA_traits<REALSXP>::value == NA_REAL);
static_assert(NA_traits<LGLSXP>::value == NA_LOGICAL);

Thanks.


Cheers

Kirill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130409/7aa608f1/attachment.html>


More information about the Rcpp-devel mailing list