[Rcpp-devel] Ease passing pointers

Tim Keitt tkeitt at gmail.com
Tue Dec 31 21:16:07 CET 2013


Can the following be simplified?

(Typed in email, so not live code.)

// [[Rcpp::export]]
void func(SEXP x)
{
  XPtr<aType> y(x);
  func2(&*y);
  y->memfunc();
}

Is there a way to avoid the need to construct the XPtr in the 1st line?
Hoping for:

// [[Rcpp::export]]
void func(aType* x)
{
  func2(x);
  x->memfunc();
}

THK

-- 
Timothy H. Keitt
http://www.keittlab.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20131231/d5bbc5cb/attachment.html>


More information about the Rcpp-devel mailing list