[Rcpp-devel] RcppModules with templated class

Dirk Eddelbuettel edd at debian.org
Mon Sep 1 22:19:09 CEST 2014

On 1 September 2014 at 19:45, Dr Gregory Jefferis wrote:
| On 1 Sep 2014, at 17:32, Romain Francois wrote:
| > This looks related to what RCPP_EXPOSED_CLASS does, perhaps because 
| > your class comes from a template, you could try 
| > RCPP_EXPOSED_CLASS_NODECL instead. The only difference is that it does 
| > not add the class forward declaration, so you'd have to have it after 
| > you have defined or declared your class.
| Thank you. You are exactly right, this was the problem and the solution.
| I still need to make an additional adjustment to my code because I had 
| separated the class declaration and instantiation, which can be 
| problematic for template classes, either by explicitly instantiating the 
| template or by moving everything into the header file.


These very useful RCPP_EXPOSED_CLASS* macros are a tad underdocumented.  

Greg, would you be interested in writing up a simple Rcpp Gallery post on that?
I would be happy to help if you'd prefer that.


http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org

More information about the Rcpp-devel mailing list