[Rcpp-commits] r1559 - in pkg/Rcpp/inst/include: . Rcpp/traits Rcpp/vector

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jun 17 10:22:44 CEST 2010


Author: romain
Date: 2010-06-17 10:22:44 +0200 (Thu, 17 Jun 2010)
New Revision: 1559

Added:
   pkg/Rcpp/inst/include/Rcpp/traits/is_trivial.h
Modified:
   pkg/Rcpp/inst/include/Rcpp/vector/traits.h
   pkg/Rcpp/inst/include/RcppCommon.h
Log:
move is_trivial in its own file

Added: pkg/Rcpp/inst/include/Rcpp/traits/is_trivial.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/traits/is_trivial.h	                        (rev 0)
+++ pkg/Rcpp/inst/include/Rcpp/traits/is_trivial.h	2010-06-17 08:22:44 UTC (rev 1559)
@@ -0,0 +1,35 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
+//
+// traits.h: Rcpp R/C++ interface class library -- support traits for vector
+//
+// 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__traits__is_trivial_h
+#define Rcpp__traits__is_trivial_h
+
+namespace Rcpp{
+namespace traits{
+
+	template <int RTYPE> struct is_trivial  : public true_type{} ;
+	template <> struct is_trivial<VECSXP>   : public false_type{} ;
+	template <> struct is_trivial<EXPRSXP>  : public false_type{} ;
+
+} // traits
+}Ê// Rcpp   
+
+#endif

Modified: pkg/Rcpp/inst/include/Rcpp/vector/traits.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/vector/traits.h	2010-06-17 08:17:57 UTC (rev 1558)
+++ pkg/Rcpp/inst/include/Rcpp/vector/traits.h	2010-06-17 08:22:44 UTC (rev 1559)
@@ -138,10 +138,6 @@
 		typedef bool type ;
 	} ;
 	
-	template <int RTYPE> struct is_trivial  : public true_type{} ;
-	template <> struct is_trivial<VECSXP>   : public false_type{} ;
-	template <> struct is_trivial<EXPRSXP>  : public false_type{} ;
-
 } // traits 
 
 #endif

Modified: pkg/Rcpp/inst/include/RcppCommon.h
===================================================================
--- pkg/Rcpp/inst/include/RcppCommon.h	2010-06-17 08:17:57 UTC (rev 1558)
+++ pkg/Rcpp/inst/include/RcppCommon.h	2010-06-17 08:22:44 UTC (rev 1559)
@@ -224,6 +224,7 @@
 #include <Rcpp/traits/r_type_traits.h>
 #include <Rcpp/traits/wrap_type_traits.h>
 #include <Rcpp/traits/is_na.h>
+#include <Rcpp/traits/is_trivial.h>
 
 #include <Rcpp/traits/is_const.h>
 #include <Rcpp/traits/is_reference.h>



More information about the Rcpp-commits mailing list