Hello everyone,

I am testing my code and find something that I hope someone can conform for
me. Thanks in advance. It seems to me that

NumericVector x = as<NumericVector>(x_); ( Btw, this is exactly the same as
NumericVector x(x_), both resulting in a shallow copy, isn't it? ) produces
a shallow copy, while
vector<double> x = as< vector<double> >(x_); produces a deep copy.

Is it because for NumvericVector the as() function returns the address of
x_? But why does it work differently for vector<double>?

Thank you for your answer.

Best,
Zhongyi
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to