[Rcpp-commits] r555 - in pkg/src/Rcpp: internal traits

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 2 08:45:56 CET 2010


Author: romain
Date: 2010-02-02 08:45:56 +0100 (Tue, 02 Feb 2010)
New Revision: 555

Modified:
   pkg/src/Rcpp/internal/r_vector.h
   pkg/src/Rcpp/traits/storage_type.h
Log:
compiler error

Modified: pkg/src/Rcpp/internal/r_vector.h
===================================================================
--- pkg/src/Rcpp/internal/r_vector.h	2010-02-02 07:30:12 UTC (rev 554)
+++ pkg/src/Rcpp/internal/r_vector.h	2010-02-02 07:45:56 UTC (rev 555)
@@ -49,7 +49,7 @@
  * an INTSXP vector is initialized with (int)0, etc...
  */
 template<int RTYPE> void r_init_vector(SEXP x){
-	typedef ::Rcpp::traits::storage_type<RTYPE>::type CTYPE ;
+	typedef typename ::Rcpp::traits::storage_type<RTYPE>::type CTYPE ;
 	CTYPE* start=r_vector_start<RTYPE>(x) ;
 	std::fill( start, start + Rf_length(x), get_zero<RTYPE,CTYPE>(0) ) ;
 }

Modified: pkg/src/Rcpp/traits/storage_type.h
===================================================================
--- pkg/src/Rcpp/traits/storage_type.h	2010-02-02 07:30:12 UTC (rev 554)
+++ pkg/src/Rcpp/traits/storage_type.h	2010-02-02 07:45:56 UTC (rev 555)
@@ -32,37 +32,50 @@
  *
  * The default is SEXP, which works for VECSXP, EXPRSXP and STRSXP
  */
-template<int RTYPE> struct storage_type{ typedef SEXP type ; } ;
+template<int RTYPE> struct storage_type{ 
+	typedef SEXP type ;
+} ;
 
+
 /**
  * Total specialization for integer vector (INTSXP)
  * typedef to int
  */
-template<> struct storage_type<INTSXP>{  typedef int type ; } ;
+template<> struct storage_type<INTSXP>{ 
+	typedef int type ;
+} ;
 
 /**
  * Total specialization for numeric vectors (REALSXP)
  * typedef to double
  */
-template<> struct storage_type<REALSXP>{ typedef double type ; } ;
+template<> struct storage_type<REALSXP>{ 
+	typedef double type ;
+} ;
 
 /**
  * Total specialization for numeric vectors (CPLXSXP)
  * typedef to Rcomplex
  */
-template<> struct storage_type<CPLXSXP>{ typedef Rcomplex type ; } ;
+template<> struct storage_type<CPLXSXP>{ 
+	typedef Rcomplex type ;
+} ;
 
 /**
  * Total specialization for raw vectors (RAWSXP)
  * typedef to Rbyte
  */
-template<> struct storage_type<RAWSXP>{ typedef Rbyte type ; } ;
+template<> struct storage_type<RAWSXP>{ 
+	typedef Rbyte type ;
+} ;
 
 /**
  * Total specialization for logical vectors (LGLSXP)
  * typedef to int
  */
-template<> struct storage_type<LGLSXP>{ typedef int type ; } ;
+template<> struct storage_type<LGLSXP>{ 
+	typedef int type ;
+} ;
 
 } // traits
 } // Rcpp



More information about the Rcpp-commits mailing list