[Rcpp-commits] r1485 - pkg/Rcpp/inst/doc/Rcpp-extending

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 8 04:25:20 CEST 2010


Author: edd
Date: 2010-06-08 04:25:19 +0200 (Tue, 08 Jun 2010)
New Revision: 1485

Modified:
   pkg/Rcpp/inst/doc/Rcpp-extending/Rcpp-extending.Rnw
Log:
minor whitespace cleanup: no two namespace declarations on the same line


Modified: pkg/Rcpp/inst/doc/Rcpp-extending/Rcpp-extending.Rnw
===================================================================
--- pkg/Rcpp/inst/doc/Rcpp-extending/Rcpp-extending.Rnw	2010-06-08 01:28:24 UTC (rev 1484)
+++ pkg/Rcpp/inst/doc/Rcpp-extending/Rcpp-extending.Rnw	2010-06-08 02:25:19 UTC (rev 1485)
@@ -158,7 +158,7 @@
 <<lang=cpp>>=
 #include <RcppCommon.h>
 
-class Foo{
+class Foo {
     public:
         Foo() ;
 
@@ -189,7 +189,7 @@
 #include <foobar.h>
 
 // declaring the specialization
-namespace Rcpp{
+namespace Rcpp {
     template <> SEXP wrap( const Bar& ) ;
 }
 
@@ -215,11 +215,13 @@
 #include <foobar.h>
 
 // declaring the partial specialization
-namespace Rcpp{ namespace traits {
+namespace Rcpp {
+    namespace traits {
 
-    template <typename T> SEXP wrap( const Bling<T>& ) ;
+        template <typename T> SEXP wrap( const Bling<T>& ) ;
 
-} }
+    }
+}
 
 // this must appear after the specialization,
 // otherwise the specialization will not be seen by Rcpp types
@@ -271,7 +273,7 @@
 #include <foobar.h>
 
 // declaring the specialization
-namespace Rcpp{
+namespace Rcpp {
     template <> Bar as( SEXP ) throw(not_compatible) ;
 }
 
@@ -290,18 +292,19 @@
 the \texttt{Rcpp::traits::Exporter} template class as follows :
 
 <<lang=cpp>>=
-namespace Rcpp{ namespace traits{
+namespace Rcpp {
+    namespace traits {
 
-    template <typename T> class Exporter{
-    public:
-        Exporter( SEXP x ) : t(x){}
-        inline T get(){ return t ; }
+        template <typename T> class Exporter{
+        public:
+            Exporter( SEXP x ) : t(x){}
+            inline T get(){ return t ; }
 
-    private:
-        T t ;
-    } ;
-
-} }
+        private:
+            T t ;
+        } ;
+    }
+}
 @
 
 This is the reason why the default behavior of \texttt{Rcpp::as} is to
@@ -317,9 +320,11 @@
 #include <foobar.h>
 
 // declaring the partial specialization
-namespace Rcpp{ namespace traits {
-    template <typename T> class Exporter< Bling<T> >;
-} }
+namespace Rcpp {
+    namespace traits {
+        template <typename T> class Exporter< Bling<T> >;
+    }
+}
 
 // this must appear after the specialization,
 // otherwise the specialization will not be seen by Rcpp types



More information about the Rcpp-commits mailing list