Extending wrap
to custom classes has always been a struggle in Rcpp
, and led to the split between RcppCommon.h
and Rcpp.h
, the idea being that you load a "minimal" subset of Rcpp, declare your class, declare that you are going to provide a specialization of wrap
, load the rest of Rcpp
(the meat), and finally define your specialization.
Let's consider this template class :
template <typename T>
class MyType {} ;