[Rcpp-commits] r4060 - in pkg/Rcpp/inst: include/Rcpp/vector unitTests/cpp

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Dec 3 14:21:20 CET 2012


Author: romain
Date: 2012-12-03 14:21:19 +0100 (Mon, 03 Dec 2012)
New Revision: 4060

Modified:
   pkg/Rcpp/inst/include/Rcpp/vector/string_proxy.h
   pkg/Rcpp/inst/unitTests/cpp/String.cpp
Log:
bugus string_proxy

Modified: pkg/Rcpp/inst/include/Rcpp/vector/string_proxy.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/vector/string_proxy.h	2012-12-03 13:04:11 UTC (rev 4059)
+++ pkg/Rcpp/inst/include/Rcpp/vector/string_proxy.h	2012-12-03 13:21:19 UTC (rev 4060)
@@ -72,11 +72,12 @@
 			return *this ;
 		}
 		
-		string_proxy& operator=(const char& rhs){
-			set( Rf_mkChar( &rhs ) ) ;
+		string_proxy& operator=(const char* rhs){
+			set( Rf_mkChar( rhs ) ) ;
 			return *this ;	
 		}
 		
+		
 		string_proxy& operator=(SEXP rhs){
 			// TODO: check this is a CHARSXP
 			set( rhs ) ;

Modified: pkg/Rcpp/inst/unitTests/cpp/String.cpp
===================================================================
--- pkg/Rcpp/inst/unitTests/cpp/String.cpp	2012-12-03 13:04:11 UTC (rev 4059)
+++ pkg/Rcpp/inst/unitTests/cpp/String.cpp	2012-12-03 13:21:19 UTC (rev 4060)
@@ -47,12 +47,12 @@
 }  
 
 // [[Rcpp::export]]
-List test_compare_Strings( String a, String b ){
+List test_compare_Strings( String aa, String bb ){
     return List::create(
-        _["a  < b" ] = a < b, 
-        _["a  > b" ] = a > b, 
-        _["a == b"]  = a == b,
-        _["a == a"]  = a == a
+        _["a  < b" ] = aa < bb, 
+        _["a  > b" ] = aa > bb, 
+        _["a == b"]  = aa == bb,
+        _["a == a"]  = aa == aa
         
         ) ;
 }



More information about the Rcpp-commits mailing list