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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Feb 8 09:34:09 CET 2013


Author: romain
Date: 2013-02-08 09:34:09 +0100 (Fri, 08 Feb 2013)
New Revision: 4246

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/inst/include/Rcpp/as.h
Log:
reenable std::string( CharacterVector[int] )

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2013-02-07 19:14:29 UTC (rev 4245)
+++ pkg/Rcpp/ChangeLog	2013-02-08 08:34:09 UTC (rev 4246)
@@ -1,3 +1,7 @@
+2013-02-08 Romain Francois <romain at r-enthusiasts.com>
+
+        * include/Rcpp/as.h: re-enable as<std::string>(  CharacterVector[int] ) 
+
 2013-02-07  Dirk Eddelbuettel  <edd at debian.org>
 
 	* inst/THANKS: Adding Ben North for the help / bug report on iterators

Modified: pkg/Rcpp/inst/include/Rcpp/as.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/as.h	2013-02-07 19:14:29 UTC (rev 4245)
+++ pkg/Rcpp/inst/include/Rcpp/as.h	2013-02-08 08:34:09 UTC (rev 4246)
@@ -44,6 +44,7 @@
         }
         
         inline const char* check_single_string( SEXP x){
+            if( TYPEOF(x) == CHARSXP ) return CHAR( x ) ;
             if( ! ::Rf_isString(x) )
                 throw ::Rcpp::not_compatible( "expecting a string" ) ;
             if (Rf_length(x) != 1)



More information about the Rcpp-commits mailing list