[Rcpp-devel] Traits for NA?

Kirill Müller kirill.mueller at ivt.baug.ethz.ch
Tue Apr 9 11:19:14 CEST 2013


Hi

On 04/09/2013 09:51 AM, Kirill Müller wrote:
> 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);

After setting up a proper C++ editor with autocompletion, I found 
Vector<T>::get_na() and finally traits::get_na(). But this is no 
compile-time constant, is it? Same applies to is_na(). I wonder if it 
makes sense at all to have these available at compile time...



Cheers

Kirill


More information about the Rcpp-devel mailing list