[Rcpp-commits] r306 - in pkg/src: . Rcpp

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 7 19:06:48 CET 2010


Author: romain
Date: 2010-01-07 19:06:48 +0100 (Thu, 07 Jan 2010)
New Revision: 306

Modified:
   pkg/src/Rcpp/wrap.h
   pkg/src/wrap.cpp
Log:
inlining some wrap

Modified: pkg/src/Rcpp/wrap.h
===================================================================
--- pkg/src/Rcpp/wrap.h	2010-01-07 17:55:03 UTC (rev 305)
+++ pkg/src/Rcpp/wrap.h	2010-01-07 18:06:48 UTC (rev 306)
@@ -61,12 +61,12 @@
 RawVector wrap(const std::set<Rbyte> & v);
 
 #ifdef HAS_INIT_LISTS
-IntegerVector wrap( std::initializer_list<int> list) ;
-NumericVector wrap( std::initializer_list<double> list) ; 
-LogicalVector wrap( std::initializer_list<bool> list) ;
-RawVector wrap(std::initializer_list<Rbyte> list) ;
-CharacterVector wrap(std::initializer_list<std::string> list );
-List wrap( std::initializer_list<RObject> list) ;
+inline IntegerVector wrap( std::initializer_list<int> list) { return IntegerVector( list ) ;}
+inline NumericVector wrap( std::initializer_list<double> list) { return NumericVector( list ); } 
+inline LogicalVector wrap( std::initializer_list<bool> list) { return LogicalVector(list); }
+inline RawVector wrap(std::initializer_list<Rbyte> list) { return RawVector(list) ; }
+inline CharacterVector wrap(std::initializer_list<std::string> list ){ return CharacterVector(list) ; }
+inline List wrap( std::initializer_list<RObject> list) { return List(list); }
 #endif
 
 } // namespace Rcpp

Modified: pkg/src/wrap.cpp
===================================================================
--- pkg/src/wrap.cpp	2010-01-07 17:55:03 UTC (rev 305)
+++ pkg/src/wrap.cpp	2010-01-07 18:06:48 UTC (rev 306)
@@ -22,9 +22,6 @@
 #include <Rcpp.h>
 
 #include <algorithm>
-#ifdef HAS_INIT_LISTS
-#include <initializer_list>
-#endif
 
 #include <Rcpp/pairlist.h>
 #include <Rcpp/grow.h>
@@ -229,26 +226,4 @@
     return o ;
 }
 
-#ifdef HAS_INIT_LISTS
-IntegerVector wrap( std::initializer_list<int> list) {
-	return IntegerVector( list ) ;
-}
-NumericVector wrap( std::initializer_list<double> list) {
-	return NumericVector( list ) ;
-}
-LogicalVector wrap( std::initializer_list<bool> list) {
-	return LogicalVector( list ) ;
-}
-RawVector wrap(std::initializer_list<Rbyte> list){
-	return RawVector( list ) ;
-}
-CharacterVector wrap(std::initializer_list<std::string> list){
-	return CharacterVector( list ) ;
-}
-List wrap( std::initializer_list<RObject> list){
-	return List( list ) ;
-}
-#endif
-
-
 } // namespace Rcpp



More information about the Rcpp-commits mailing list