[Rcpp-commits] r3987 - in pkg/Rcpp: . inst/include inst/include/Rcpp/internal
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Nov 17 01:22:13 CET 2012
Author: romain
Date: 2012-11-17 01:22:12 +0100 (Sat, 17 Nov 2012)
New Revision: 3987
Added:
pkg/Rcpp/inst/include/Rcpp/internal/wrap_end.h
Modified:
pkg/Rcpp/ChangeLog
pkg/Rcpp/inst/include/Rcpp.h
pkg/Rcpp/inst/include/Rcpp/internal/wrap.h
Log:
deal with order of includes ... etc
Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog 2012-11-16 21:28:09 UTC (rev 3986)
+++ pkg/Rcpp/ChangeLog 2012-11-17 00:22:12 UTC (rev 3987)
@@ -1,3 +1,8 @@
+2012-11-17 Romain Francois <romain at r-enthusiasts.com>
+
+ * include/Rcpp/internal/wrap_end.h: have calls to wrap as late as possible
+ so that they "see" all (potentially user defined) overloads of wrap.
+
2012-11-16 Romain Francois <romain at r-enthusiasts.com>
* include/Rcpp/vector/Vector.h : added static methods Vector::is_na and
Modified: pkg/Rcpp/inst/include/Rcpp/internal/wrap.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/internal/wrap.h 2012-11-16 21:28:09 UTC (rev 3986)
+++ pkg/Rcpp/inst/include/Rcpp/internal/wrap.h 2012-11-17 00:22:12 UTC (rev 3987)
@@ -812,15 +812,12 @@
return R_NilValue ;
}
+// these are defined in wrap_end.h
template <typename T>
-inline SEXP module_wrap_dispatch( const T& obj, Rcpp::traits::pointer_wrap_tag ){
- return wrap( object< typename traits::un_pointer<T>::type >( obj ) ) ;
-}
+inline SEXP module_wrap_dispatch( const T& obj, Rcpp::traits::pointer_wrap_tag ) ;
template <typename T>
-inline SEXP module_wrap_dispatch( const T& obj, Rcpp::traits::normal_wrap_tag ){
- return wrap( obj ) ;
-}
+inline SEXP module_wrap_dispatch( const T& obj, Rcpp::traits::normal_wrap_tag ) ;
template <typename T>
inline SEXP module_wrap( const T& obj ){
Added: pkg/Rcpp/inst/include/Rcpp/internal/wrap_end.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/internal/wrap_end.h (rev 0)
+++ pkg/Rcpp/inst/include/Rcpp/internal/wrap_end.h 2012-11-17 00:22:12 UTC (rev 3987)
@@ -0,0 +1,37 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
+//
+// wrap_end.h: R/C++ interface class library
+//
+// Copyright (C) 2012 Dirk Eddelbuettel and Romain Francois
+//
+// This file is part of Rcpp.
+//
+// Rcpp is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// Rcpp is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef Rcpp_internal_wrap_end_h
+#define Rcpp_internal_wrap_end_h
+
+namespace Rcpp{
+ template <typename T>
+ inline SEXP module_wrap_dispatch( const T& obj, Rcpp::traits::normal_wrap_tag ){
+ return wrap( obj ) ;
+ }
+ template <typename T>
+ inline SEXP module_wrap_dispatch( const T& obj, Rcpp::traits::pointer_wrap_tag ) {
+ return wrap( object< typename traits::un_pointer<T>::type >( obj ) ) ;
+ }
+}
+
+
+#endif
Modified: pkg/Rcpp/inst/include/Rcpp.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp.h 2012-11-16 21:28:09 UTC (rev 3986)
+++ pkg/Rcpp/inst/include/Rcpp.h 2012-11-17 00:22:12 UTC (rev 3987)
@@ -71,4 +71,8 @@
// wrappers for R API 'scalar' functions
#include <Rcpp/Rmath.h>
+// this stays at the very end, because it needs to
+// 'see' all versions of wrap
+#include <Rcpp/internal/wrap_end.h>
+
#endif
More information about the Rcpp-commits
mailing list