[Rcpp-devel] const operators

Romain Francois romain at r-enthusiasts.com
Mon Jul 5 23:55:45 CEST 2010


Le 05/07/10 23:51, Jonathan Chang a écrit :
> I noticed that for Rcpp::Vector there is no const () operator.  For
> example,
>
> double foo(const Rcpp::Vector<REALSXP>& bar) {  return bar(0); }
>
> will fail.  Is there a workaround for this?  Thanks!
>
> Cheers,
> Jonathan

Hi,

Apart from using const_cast, I know of no workaround.
We should provide const versions. I've just added it on the TODO file.

Romain

-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://bit.ly/98Uf7u : Rcpp 0.8.1
|- http://bit.ly/c6YnCi : graph gallery collage
`- http://bit.ly/bZ7ltC : inline 0.3.5



More information about the Rcpp-devel mailing list