[Rcpp-devel] c++ class as argument in rcpp function (using modules)

Darren Cook darren at dcook.org
Wed Dec 21 23:56:21 CET 2011


>     void addMsg(World& w2) {
> msg = msg + w2.msg;
>     }

BTW, this could be (and should be)
  void addMsg(const World& w2) { ...}

> error: no matching function for call to ‘World::World(SEXPREC*&)’

How about something like:

  World(SEXPREC* &w2){
    msg= ((World*)w2)->msg;
  }

Darren

-- 
Darren Cook, Software Researcher/Developer

http://dcook.org/work/ (About me and my work)
http://dcook.org/blogs.html (My blogs and articles)


More information about the Rcpp-devel mailing list