Skip to content
Prev 5842 / 10988 Next

[Rcpp-devel] Pass a function name as an argument.

Hi JJ,

Thank you for the reply. I would actually like to pass C++ functions to the
C++ function foo(). To be more specific, the user will indicate in the R
environment which of the two functions (fun1 or fun2) to pass to foo().
foo() will somehow use the chosen one accordingly. I suppose one option is
to wrap foo() inside another function. The wrapper function can take input
from the user from R, and then based on what the input is choose the
appropriate function (fun1 or fun2). But the question of how to pass
functions with different numbers of arguments still remains.  I wonder if
you have any thoughts. Thank you again!

Best,
Xiao
On Sat, May 18, 2013 at 12:45 PM, JJ Allaire <jj.allaire at gmail.com> wrote:

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