Re: [Rcpp-devel] Passing template class as argument in Rcpp function

2021-03-05 Thread Dirk Eddelbuettel
On 5 March 2021 at 18:44, Iñaki Ucar wrote: | Excellent. Note that the clone method was required for my use case, but it | may be superfluous for yours. It's very nice to do it straight up with the XPtr class. A variant using Rcpp Modules is offerend byy RcppAnnoy -- also templated. Dirk -- h

Re: [Rcpp-devel] Passing template class as argument in Rcpp function

2021-03-05 Thread Iñaki Ucar
Excellent. Note that the clone method was required for my use case, but it may be superfluous for yours. Iñaki El vie., 5 mar. 2021 17:15, Subhomoy Ghosh escribió: > Thanks, Iñaki! Your package gave me enough hints to create the following > attempt which seemed to have worked. > > #include > >

Re: [Rcpp-devel] Passing template class as argument in Rcpp function

2021-03-05 Thread Subhomoy Ghosh
Thanks, Iñaki! Your package gave me enough hints to create the following attempt which seemed to have worked. #include using namespace Rcpp; using namespace arma; // [[Rcpp::depends(RcppArmadillo)]] class Distribution { public: virtual Distribution* clone() {return (new Distribution(*this))