[Rcpp-commits] r591 - in pkg/src: . Rcpp

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Feb 6 11:48:20 CET 2010


Author: romain
Date: 2010-02-06 11:48:19 +0100 (Sat, 06 Feb 2010)
New Revision: 591

Modified:
   pkg/src/Rcpp/as.h
   pkg/src/as.cpp
Log:
added a specialized as<SEXP>

Modified: pkg/src/Rcpp/as.h
===================================================================
--- pkg/src/Rcpp/as.h	2010-02-06 10:29:03 UTC (rev 590)
+++ pkg/src/Rcpp/as.h	2010-02-06 10:48:19 UTC (rev 591)
@@ -43,6 +43,9 @@
 	T t(m_sexp);
 	return t ;
 }
+
+template<> SEXP as(SEXP m_sexp) ;
+
 /**
  * Converts the R object to a bool. 
  * 

Modified: pkg/src/as.cpp
===================================================================
--- pkg/src/as.cpp	2010-02-06 10:29:03 UTC (rev 590)
+++ pkg/src/as.cpp	2010-02-06 10:48:19 UTC (rev 591)
@@ -23,6 +23,10 @@
 
 namespace Rcpp{ 
 
+template<> SEXP as<SEXP>(SEXP m_sexp){
+	return m_sexp ;
+}
+
 template<> double as<double>(SEXP m_sexp) {
     if (Rf_length(m_sexp) != 1) {
 	throw std::range_error("as<double> expects single value");



More information about the Rcpp-commits mailing list