Skip to content

Commit c87e4de

Browse files
romainfrancoiseddelbuettel
authored andcommitted
Function.invoke() to help operator()
1 parent d65f3c0 commit c87e4de

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

inst/include/Rcpp/Function.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ namespace Rcpp{
111111
Shield<SEXP> x( Rf_findFun( nameSym, env ) ) ;
112112
Storage::set__(x) ;
113113
}
114+
115+
SEXP invoke(SEXP args_, SEXP env) const {
116+
Shield<SEXP> args(args_);
117+
Shield<SEXP> call(Rcpp_lcons(Storage::get__(), args));
118+
SEXP out = Rcpp_fast_eval(call, env);
119+
return out;
120+
}
121+
114122
};
115123

116124
typedef Function_Impl<PreserveStorage> Function ;

0 commit comments

Comments
 (0)