Skip to content
Prev 6951 / 10988 Next

[Rcpp-devel] Ease passing pointers

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