[Rcpp-devel] Can Rcpp::InternalFunction have a variadic function as the argument

Pratibha Rana pratibha.r.tomar at gmail.com
Thu Mar 8 16:55:19 CET 2012


Hi,

I'm trying to do something like this :

void RLogger(const char *format,...)
{
  va_list ap;
  va_start(ap,format);
  mylogger.write("R Log:",format, ap);
  va_end(ap);

}

int main(int argc, char *argv[])
{
   RInside RGlobal;
   RGlobal["my_log"] = Rcpp::InternalFunction(&RLogger);
   return go(argc, argv);
}



But this doesn't compile. I get the following error

error: initializing argument 1 of
‘Rcpp::InternalFunction::InternalFunction(OUT (*)(U0)) [with OUT = void, U0
= const char*]’


I was wondering if the variadic functions are allowed in the
InternalFunction, because it works if I have a single argument.


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


More information about the Rcpp-devel mailing list