[Rcpp-commits] r2448 - scripts
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Nov 18 21:23:36 CET 2010
Author: romain
Date: 2010-11-18 21:23:36 +0100 (Thu, 18 Nov 2010)
New Revision: 2448
Modified:
scripts/generator_Module_Pointer_method.R
Log:
pass down the validator
Modified: scripts/generator_Module_Pointer_method.R
===================================================================
--- scripts/generator_Module_Pointer_method.R 2010-11-18 20:19:36 UTC (rev 2447)
+++ scripts/generator_Module_Pointer_method.R 2010-11-18 20:23:36 UTC (rev 2448)
@@ -13,8 +13,8 @@
txt <- sprintf( '
template <typename OUT, %s>
- self& method( const char* name_, OUT (*fun)(Class*, %s) ){
- AddMethod( name_, new Pointer_CppMethod%d<Class,OUT,%s>( fun ) ) ;
+ self& method( const char* name_, OUT (*fun)(Class*, %s), ValidMethod valid = &yes_arity<%d> ){
+ AddMethod( name_, new Pointer_CppMethod%d<Class,OUT,%s>( fun ), valid ) ;
return *this ;
}
@@ -23,6 +23,7 @@
typenames, # typename U0, ...
u, # U0 u0, ...
i,
+i,
U # U0, ...
)
@@ -55,8 +56,8 @@
#define Rcpp_Module_generated_Pointer_method_h
template <typename OUT>
- self& method( const char* name_, OUT (*fun)(Class*) ){
- AddMethod( name_, new Pointer_CppMethod0<Class,OUT>( fun ) ) ;
+ self& method( const char* name_, OUT (*fun)(Class*), ValidMethod valid = &yes ){
+ AddMethod( name_, new Pointer_CppMethod0<Class,OUT>( fun ), valid ) ;
return *this ;
}
More information about the Rcpp-commits
mailing list