[Rcpp-commits] r1558 - in pkg/Rcpp/inst: . include/Rcpp include/Rcpp/vector
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jun 17 10:17:57 CEST 2010
Author: romain
Date: 2010-06-17 10:17:57 +0200 (Thu, 17 Jun 2010)
New Revision: 1558
Added:
pkg/Rcpp/inst/include/Rcpp/vector/swap.h
Modified:
pkg/Rcpp/inst/ChangeLog
pkg/Rcpp/inst/include/Rcpp/Vector.h
Log:
comment
Modified: pkg/Rcpp/inst/ChangeLog
===================================================================
--- pkg/Rcpp/inst/ChangeLog 2010-06-17 08:09:58 UTC (rev 1557)
+++ pkg/Rcpp/inst/ChangeLog 2010-06-17 08:17:57 UTC (rev 1558)
@@ -1,6 +1,10 @@
2010-06-17 Romain Francois <romain at r-enthusiasts.com>
* inst/include/Rcpp/Vector.h: split into more manageable files
+
+ * inst/include/Rcpp/vector/VectorBase.h: simplify the VectorBase class
+ so that it is just implementing CRTP. It does not inherit from RObject anymore.
+ This will help implementation of sugar.
2010-06-16 Dirk Eddelbuettel <edd at debian.org>
Modified: pkg/Rcpp/inst/include/Rcpp/Vector.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Vector.h 2010-06-17 08:09:58 UTC (rev 1557)
+++ pkg/Rcpp/inst/include/Rcpp/Vector.h 2010-06-17 08:17:57 UTC (rev 1558)
@@ -49,24 +49,8 @@
#include <Rcpp/vector/instantiation.h>
#include <Rcpp/vector/string_proxy.h>
+#include <Rcpp/vector/swap.h>
} // Rcpp
-namespace std {
-
-#undef RCPP_GENERATE_SWAP
-#define RCPP_GENERATE_SWAP(TYPE,RTYPE) \
- template<> inline void swap< Rcpp::internal::TYPE<RTYPE> >( \
- Rcpp::internal::TYPE<RTYPE>& a , \
- Rcpp::internal::TYPE<RTYPE>& b) { \
- a.swap(b) ; \
- }
-
-RCPP_GENERATE_SWAP( generic_proxy,VECSXP)
-RCPP_GENERATE_SWAP( generic_proxy,EXPRSXP)
-RCPP_GENERATE_SWAP( string_proxy,STRSXP)
-#undef RCPP_GENERATE_SWAP
-
-}
-
#endif
Added: pkg/Rcpp/inst/include/Rcpp/vector/swap.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/vector/swap.h (rev 0)
+++ pkg/Rcpp/inst/include/Rcpp/vector/swap.h 2010-06-17 08:17:57 UTC (rev 1558)
@@ -0,0 +1,42 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
+//
+// swap.h: Rcpp R/C++ interface class library --
+//
+// Copyright (C) 2010 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__vector__swap_h
+#define Rcpp__vector__swap_h
+
+namespace std {
+
+#undef RCPP_GENERATE_SWAP
+#define RCPP_GENERATE_SWAP(TYPE,RTYPE) \
+ template<> inline void swap< Rcpp::internal::TYPE<RTYPE> >( \
+ Rcpp::internal::TYPE<RTYPE>& a , \
+ Rcpp::internal::TYPE<RTYPE>& b) { \
+ a.swap(b) ; \
+ }
+
+RCPP_GENERATE_SWAP( generic_proxy,VECSXP)
+RCPP_GENERATE_SWAP( generic_proxy,EXPRSXP)
+RCPP_GENERATE_SWAP( string_proxy,STRSXP)
+#undef RCPP_GENERATE_SWAP
+
+}
+
+#endif
More information about the Rcpp-commits
mailing list