Skip to content
Prev 1229 / 10988 Next

[Rcpp-devel] ambiguous overload for ‘operator[]’

You're mixing NumericVectors, std::vectors, and XPtrs, not to mention using plain C's memcpy to copy C++ objects. Even if it compiled, I'd be surprised if this code worked correctly. 

If you want to copy pdA into v, you should probably use std::copy with iterators (with v as the target, not pdB). Telling v's constructor the size to pre-allocate would be good, too.

Davor
On 2010-10-27, at 3:22 PM, Kaveh Vakili wrote: