[Rcpp-commits] r3943 - pkg/Rcpp/inst/include/Rcpp/vector

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Nov 12 14:11:04 CET 2012


Author: romain
Date: 2012-11-12 14:11:03 +0100 (Mon, 12 Nov 2012)
New Revision: 3943

Modified:
   pkg/Rcpp/inst/include/Rcpp/vector/CharacterVectorExtractionIterator.h
   pkg/Rcpp/inst/include/Rcpp/vector/traits.h
Log:
was not returning a proper const_iterator

Modified: pkg/Rcpp/inst/include/Rcpp/vector/CharacterVectorExtractionIterator.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/vector/CharacterVectorExtractionIterator.h	2012-11-12 12:47:58 UTC (rev 3942)
+++ pkg/Rcpp/inst/include/Rcpp/vector/CharacterVectorExtractionIterator.h	2012-11-12 13:11:03 UTC (rev 3943)
@@ -33,7 +33,7 @@
     typedef const char*& reference;
     typedef std::input_iterator_tag iterator_category;
     
-    CharacterVectorExtractionIterator( const CharacterVector& vec) : ptr( get_string_ptr( vec) ){}
+    CharacterVectorExtractionIterator( const CharacterVector& vec) : ptr( get_string_ptr(vec) ){}
     
     CharacterVectorExtractionIterator( const CharacterVectorExtractionIterator& other) : ptr(other.ptr){}
     CharacterVectorExtractionIterator& operator=(const CharacterVectorExtractionIterator& other){ ptr = other.ptr ; return *this ;}

Modified: pkg/Rcpp/inst/include/Rcpp/vector/traits.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/vector/traits.h	2012-11-12 12:47:58 UTC (rev 3942)
+++ pkg/Rcpp/inst/include/Rcpp/vector/traits.h	2012-11-12 13:11:03 UTC (rev 3943)
@@ -64,7 +64,7 @@
 			RCPP_DEBUG_3( " cache<%d>::update( <%p> ), p = <%p>", RTYPE, reinterpret_cast<void*>(v.asSexp()),  reinterpret_cast<void*>(p) ) ;
 		}
 		inline iterator get() const { return iterator( proxy(*p, 0 ) ) ;}
-		inline iterator get_const() const { return const_iterator( proxy(*p, 0 ) ) ;}
+		inline const_iterator get_const() const { return const_iterator( *p ) ;}
 		
 		inline proxy ref() const { return proxy(*p,0) ; }
 		inline proxy ref(int i) const { return proxy(*p,i);}



More information about the Rcpp-commits mailing list