Re: [Rcpp-devel] Ease passing pointers

2013-12-31 Thread Tim Keitt
On Tue, Dec 31, 2013 at 3:55 PM, Dirk Eddelbuettel wrote: > > On 31 December 2013 at 15:27, Tim Keitt wrote: > | A little obscure indeed. I got a little lost in the documentation and was > | looking for a shortcut. I think I need to specialize "wrap" and "as". > > Yes, many adaptations to local d

Re: [Rcpp-devel] Ease passing pointers

2013-12-31 Thread Dirk Eddelbuettel
On 31 December 2013 at 15:27, Tim Keitt wrote: | A little obscure indeed. I got a little lost in the documentation and was | looking for a shortcut. I think I need to specialize "wrap" and "as". Yes, many adaptations to local data structures need that. There are a few example posts, eg on the Rcp

Re: [Rcpp-devel] Ease passing pointers

2013-12-31 Thread Tim Keitt
On Tue, Dec 31, 2013 at 3:10 PM, Dirk Eddelbuettel wrote: > > On 31 December 2013 at 14:16, Tim Keitt wrote: > | Can the following be simplified? > | > | (Typed in email, so not live code.) > | > | // [[Rcpp::export]] > | void func(SEXP x) > | { > | XPtr y(x); > | func2(&*y); > | y->memfunc

Re: [Rcpp-devel] Ease passing pointers

2013-12-31 Thread Dirk Eddelbuettel
On 31 December 2013 at 14:16, Tim Keitt wrote: | Can the following be simplified? | | (Typed in email, so not live code.) | | // [[Rcpp::export]] | void func(SEXP x) | { |   XPtr y(x); |   func2(&*y); |   y->memfunc(); | } | | Is there a way to avoid the need to construct the XPtr in the 1st li

[Rcpp-devel] Ease passing pointers

2013-12-31 Thread Tim Keitt
Can the following be simplified? (Typed in email, so not live code.) // [[Rcpp::export]] void func(SEXP x) { XPtr 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