Rcpp pass by reference vs. by value

They key is ‘proxy model’ — your xa really is the same memory location as your original object so you end up changing your original. If you don’t want that, you should do one thing: (deep) copy using the clone() method, or maybe explicit creation of a new object into which the altered object gets … Read more

tech