[Rcpp-commits] r2950 - in pkg/Rcpp/inst/include/Rcpp: . vector

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 5 12:21:18 CEST 2011


Author: romain
Date: 2011-04-05 12:21:18 +0200 (Tue, 05 Apr 2011)
New Revision: 2950

Modified:
   pkg/Rcpp/inst/include/Rcpp/Vector.h
   pkg/Rcpp/inst/include/Rcpp/vector/RangeIndexer.h
Log:
something that had nor been commited before

Modified: pkg/Rcpp/inst/include/Rcpp/Vector.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Vector.h	2011-04-05 10:19:09 UTC (rev 2949)
+++ pkg/Rcpp/inst/include/Rcpp/Vector.h	2011-04-05 10:21:18 UTC (rev 2950)
@@ -30,7 +30,13 @@
 #include <Rcpp/Dimension.h>
 
 namespace Rcpp{
+    namespace traits{
+         template <int RTYPE, bool NA, typename VECTOR> struct Extractor ;  
+    }
+}
 
+namespace Rcpp{
+
 #include <Rcpp/vector/00_forward_Vector.h>
 #include <Rcpp/vector/00_forward_proxy.h>
 #include <Rcpp/vector/00_forward_eval_methods.h>

Modified: pkg/Rcpp/inst/include/Rcpp/vector/RangeIndexer.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/vector/RangeIndexer.h	2011-04-05 10:19:09 UTC (rev 2949)
+++ pkg/Rcpp/inst/include/Rcpp/vector/RangeIndexer.h	2011-04-05 10:21:18 UTC (rev 2950)
@@ -21,9 +21,10 @@
 
 #ifndef Rcpp__vector__RangeIndexer_h
 #define Rcpp__vector__RangeIndexer_h
-
+       
 #define UNROLL_LOOP(OP)                              \
-    const T& input = x.get_ref() ;                   \
+    typedef typename ::Rcpp::traits::Extractor<RTYPE,NA,T>::type EXT ; \
+    const EXT& input( x.get_ref() ) ;                   \
     int __trip_count = (size_) >> 2;                 \
     int i=0 ;                                        \
     for ( ; __trip_count > 0 ; --__trip_count) {     \



More information about the Rcpp-commits mailing list