[Rcpp-devel] [Rcpp Modules] Static functions

Julien Duvanel julien.duvanel at epfl.ch
Thu May 9 16:47:36 CEST 2013


Hello,  

First of all, thanks for all the Rcpp*. It's very helpful.

I have a small question, and I can't (unfortunately) find the answer over the internet. I'm trying to do this :

class Foo {
public:
double static myFunction();
};

And then, use the RCPP_MODULE :

RCPP_MODULE(mod_Foo) {
class_<Foo>("Foo")

.method("myFunction", &Foo::MyFunction", "bla bla bla")
}

Unfortunately, it doesn't compile and gives me the following error :

integration.h:82: error: no matching function for call to ‘Rcpp::class_<NewModel>::method(const char [12], Rcpp::NumericVector (*)(Rcpp::NumericVector, Rcpp::NumericVector, double, double, double, double, int), const char [37])’

Maybe it just works as intended, but I haven't found anything inside the documentation. (It works when I remove the static). Has anybody an idea ?

Thank you very much and have a nice day,

Julien  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130509/cf960244/attachment.html>


More information about the Rcpp-devel mailing list