Rcpp does not generally know how to convert a `std::shared_ptr` to an R object. 
What this does here is very specific to this package, and not generic. 

When `const std::shared_ptr<T>& x` is received as an input, the R object that 
is actually passed in is the R6 wrapper around the external pointer, so it 
looks for it in the environment where R6 hides it. 

When a function returns a `std::shared_ptr<T>` the function simply return a new 
external pointer to this shared pointer, and the R side takes over and create a 
new R6 object. 

I should write some blog post about this I guess. 



[ Full content available at: https://github.com/apache/arrow/pull/2596 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to