[Rcpp-commits] r4351 - scripts

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 19 23:03:22 CEST 2013


Author: romain
Date: 2013-06-19 23:03:21 +0200 (Wed, 19 Jun 2013)
New Revision: 4351

Modified:
   scripts/generator_Module_CppMethod.R
   scripts/generator_Module_PointerCppMethod.R
Log:
updated generators

Modified: scripts/generator_Module_CppMethod.R
===================================================================
--- scripts/generator_Module_CppMethod.R	2013-06-19 20:41:28 UTC (rev 4350)
+++ scripts/generator_Module_CppMethod.R	2013-06-19 21:03:21 UTC (rev 4351)
@@ -16,10 +16,11 @@
 	public:
 		typedef OUT (Class::*Method)(%s) ;
 		typedef CppMethod<Class> method_class ;
+		typedef typename Rcpp::traits::remove_const_and_reference< OUT >::type CLEANED_OUT ;
 		
 		CppMethod%d(Method m) : method_class(), met(m) {} 
 		SEXP operator()( Class* object, SEXP* args){
-			return Rcpp::module_wrap<OUT>( (object->*met)( %s ) ) ;
+			return Rcpp::module_wrap<CLEANED_OUT>( (object->*met)( %s ) ) ;
 		}
 		inline int nargs(){ return %d ; }
 		inline bool is_void(){ return false ; }
@@ -56,10 +57,11 @@
 	public:
 		typedef OUT (Class::*Method)(%s) const ;
 		typedef CppMethod<Class> method_class ;
+		typedef typename Rcpp::traits::remove_const_and_reference< OUT >::type CLEANED_OUT ;
 		
 		const_CppMethod%d(Method m) : method_class(), met(m){} 
 		SEXP operator()( Class* object, SEXP* args){
-			return Rcpp::module_wrap<OUT>( (object->*met)( %s ) ) ;
+			return Rcpp::module_wrap<CLEANED_OUT>( (object->*met)( %s ) ) ;
 		}
 		inline int nargs(){ return %d ; }
 		inline bool is_void(){ return false ; }
@@ -158,9 +160,11 @@
 	public:
 		typedef OUT (Class::*Method)(void) ;
 		typedef CppMethod<Class> method_class ;
+		typedef typename Rcpp::traits::remove_const_and_reference< OUT >::type CLEANED_OUT ;
+		
 		CppMethod0( Method m) : method_class(), met(m){} 
 		SEXP operator()( Class* object, SEXP*){
-			return Rcpp::module_wrap<OUT>( (object->*met)( ) ) ;
+			return Rcpp::module_wrap<CLEANED_OUT>( (object->*met)( ) ) ;
 		}
 		inline int nargs(){ return 0 ; }
 		inline bool is_void(){ return false ; }
@@ -193,9 +197,11 @@
 	public:
 		typedef OUT (Class::*Method)(void) const ;
 		typedef CppMethod<Class> method_class ;
+		typedef typename Rcpp::traits::remove_const_and_reference< OUT >::type CLEANED_OUT ;
+		
 		const_CppMethod0( Method m) : method_class(), met(m){} 
 		SEXP operator()( Class* object, SEXP* ){
-			return Rcpp::module_wrap<OUT>( (object->*met)( ) ) ;
+			return Rcpp::module_wrap<CLEANED_OUT>( (object->*met)( ) ) ;
 		}
 		inline int nargs(){ return 0 ; }
 		inline bool is_void(){ return false ; }

Modified: scripts/generator_Module_PointerCppMethod.R
===================================================================
--- scripts/generator_Module_PointerCppMethod.R	2013-06-19 20:41:28 UTC (rev 4350)
+++ scripts/generator_Module_PointerCppMethod.R	2013-06-19 21:03:21 UTC (rev 4351)
@@ -16,10 +16,11 @@
 	public:
 		typedef OUT (*Method)(Class*, %s) ;
 		typedef CppMethod<Class> method_class ;
+		typedef typename Rcpp::traits::remove_const_and_reference< OUT >::type CLEANED_OUT ;
 		
 		Pointer_CppMethod%d(Method m) : method_class(), met(m){} 
 		SEXP operator()( Class* object, SEXP* args){
-			return Rcpp::module_wrap<OUT>( met( object, %s ) ) ;
+		    return Rcpp::module_wrap<CLEANED_OUT>( met( object, %s ) ) ;
 		}
 		inline int nargs(){ return %d ; }
 		inline bool is_void(){ return false ; }
@@ -56,10 +57,11 @@
 	public:
 		typedef OUT (*Method)(const Class*, %s) ;
 		typedef CppMethod<Class> method_class ;
+		typedef typename Rcpp::traits::remove_const_and_reference< OUT >::type CLEANED_OUT ;
 		
 		Const_Pointer_CppMethod%d(Method m) : method_class(), met(m){} 
 		SEXP operator()( Class* object, SEXP* args){
-			return Rcpp::module_wrap<OUT>( met( object, %s ) ) ;
+			return Rcpp::module_wrap<CLEANED_OUT>( met( object, %s ) ) ;
 		}
 		inline int nargs(){ return %d ; }
 		inline bool is_void(){ return false ; }



More information about the Rcpp-commits mailing list