Re: [Rcpp-devel] Problem with IntegerVector::value_type in recent Rcpp

2015-03-31 Thread Romain François
Probably just my incompetence at the time of writing it. Would be trivial enough to fix in Rcpp for anyone with the proper skills and willingness. I only have 1.05 of those 2. Romain > Le 31 mars 2015 à 17:39, Kevin Thornton a écrit : > > Thanks for the explanation, Romain. > > As a follow-

Re: [Rcpp-devel] Problem with IntegerVector::value_type in recent Rcpp

2015-03-31 Thread Kevin Thornton
Thanks for the explanation, Romain. As a follow-up, is there a reason why value_type is defined in terms of a reference? In the mean time, I'll use remove_reference. -Kevin > On Mar 31, 2015, at 1:04 AM, Romain François wrote: > > Hi, > > That’s because VTYPE::value_type is traits::r_vect

Re: [Rcpp-devel] Problem with IntegerVector::value_type in recent Rcpp

2015-03-31 Thread Romain François
Hi, That’s because VTYPE::value_type is traits::r_vector_proxy::type, i.e. template struct r_vector_proxy{ typedef typename storage_type::type& type ; } ; so VTYPE::value_type is int& You can either use stored_type, i.e. std::for_each( v.begin(), v.end(),[]( const VTYPE::s